Skip to content

Commit

Permalink
Merge pull request #4120 from neolefty/import-data-instructions
Browse files Browse the repository at this point in the history
Instructions for importing a data download in a Docker Compose dev env
  • Loading branch information
mjy authored Dec 7, 2024
2 parents eadccf2 + 03ddc56 commit 8a33c47
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/views/tasks/projects/data/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
<h3> Export SQL </h3>
<p><em>Generate a downloadable copy of the database (PostgreSQL dump) with all data referenced in this project. Includes Community data like Sources, People, and Repositories.</em></p>
<p> Restorable with <b>psql -U :username -d :database -f dump.sql</b>. Requires database to be created without tables (<b>rails db:create</b>) </p>
<p>To import into a <code>docker compose</code> development environment:</p>
<ol>
<li>Download and unzip the file. In this example, assume that creates a local file <code>unzip/dump.sql</code></li>
<li>Drop existing DB: <code>docker compose exec app bundle exec rails db:drop</code></li>
<li>Create empty DB: <code>docker compose exec app bundle exec rails db:create</code></li>
<li>Restore DB: <code>docker compose exec --no-TTY db psql -U postgres -d taxonworks_development -f - < unzip/dump.sql</code></li>
</ol>

<div>
<%= form_tag(generate_sql_download_task_path, method: :get) do %>
Expand Down

0 comments on commit 8a33c47

Please sign in to comment.