mirror of
https://github.com/inventree/inventree-website.git
synced 2026-03-07 12:04:17 +00:00
deploy: 53cf548415
This commit is contained in:
@@ -89,6 +89,8 @@
|
||||
|
||||
<h2 id="migration-guide">Migration Guide</h2>
|
||||
|
||||
<p><em>Note: This procedure was updated on 2026-02-19</em></p>
|
||||
|
||||
<p>Our documentation provides a detailed <a href="https://docs.inventree.org/en/stable/start/migrate/#migrating-between-incompatible-database-versions">database migration guide</a> to assist users with this process. We recommend that users perform a backup of their database before attempting the migration, and follow the instructions carefully to ensure a smooth transition to the new database version.</p>
|
||||
|
||||
<p>Following is an example of the steps involved in migrating an InvenTree installation from a PostgreSQL 13 database to a PostgreSQL 17 database, in the context of a docker installation. The same principles apply for non-docker installations, but the particular commands may differ.</p>
|
||||
@@ -117,7 +119,28 @@
|
||||
|
||||
<p>The new installation will be running InvenTree 1.2.0 with PostgreSQL 17</p>
|
||||
|
||||
<h2 id="step-1-perform-backup">Step 1. Perform Backup</h2>
|
||||
<h3 id="data-backup">Data Backup</h3>
|
||||
|
||||
<p>It is prudent to perform a regular backup of the database, before following the migration procedure. This can be done using the <code class="language-plaintext highlighter-rouge">invoke backup</code> command, as described in the documentation. This will create a backup of the database and media files in the <code class="language-plaintext highlighter-rouge">data/backup</code> directory.</p>
|
||||
|
||||
<h2 id="step-1-ensure-starting-conditions-are-met">Step 1. Ensure Starting Conditions are Met</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<code class="language-plaintext highlighter-rouge">postgres:13</code> is set in <code class="language-plaintext highlighter-rouge">docker-compose.yml</code>
|
||||
</li>
|
||||
<li>
|
||||
<code class="language-plaintext highlighter-rouge">INVENTREE_VERSION=1.1.12</code> is set in <code class="language-plaintext highlighter-rouge">.env</code>
|
||||
</li>
|
||||
<li>Database schema has been updated to the latest version:</li>
|
||||
</ul>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose up inventree-db -d
|
||||
docker compose run --rm inventree-server invoke update
|
||||
docker compose down
|
||||
</code></pre></div></div>
|
||||
|
||||
<h2 id="step-2-perform-manual-backup">Step 2. Perform Manual Backup</h2>
|
||||
|
||||
<p>The first step is to perform a backup of the existing database. This step must be performed with the old setup (postgres 13 / InvenTree 1.1.12), before we perform any updates to the software.</p>
|
||||
|
||||
@@ -128,26 +151,30 @@
|
||||
<p>To perform the backup, we run the following commands:</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose up inventree-db -d
|
||||
docker compose run --rm inventree-server invoke backup
|
||||
docker compose run --rm inventree-server pg_dump postgresql://pguser@inventree-db:5432/inventree -f /home/inventree/data/backup/db_migrations.sql
|
||||
docker compose down
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>This will create a backup of the database and media files in the <code class="language-plaintext highlighter-rouge">data/backup</code> directory.</p>
|
||||
<p><em>Note: You will be prompted for the password for the <code class="language-plaintext highlighter-rouge">pguser</code> user. This is the password that you set in the <code class="language-plaintext highlighter-rouge">.env</code> file (default is <code class="language-plaintext highlighter-rouge">pgpassword</code>).</em></p>
|
||||
|
||||
<p><em>Note: Do not change the path to the migrations file, this is the internal docker container path, and should not be changed.</em></p>
|
||||
|
||||
<p>This will create a backup of the database and media files in the <code class="language-plaintext highlighter-rouge">inventree-data/backup</code> directory (external to the docker containers). The database backup will be saved as <code class="language-plaintext highlighter-rouge">db_migrations.sql</code>.</p>
|
||||
|
||||
<p>Confirm that the backup files have been created before continuing to the next step.</p>
|
||||
|
||||
<h2 id="step-2-move-database-directory">Step 2. Move Database Directory</h2>
|
||||
<h2 id="step-3-move-database-directory">Step 3. Move Database Directory</h2>
|
||||
|
||||
<p>The PostgreSQL database files are stored in the <code class="language-plaintext highlighter-rouge">data/pgdb</code> directory. We need to remove these files, as they are specific to PostgreSQL 13 and will not be compatible with PostgreSQL 17. Rather than deleting them, we will move them to a backup location, just in case we need to revert back to the old setup.</p>
|
||||
<p>The PostgreSQL database files are stored in the <code class="language-plaintext highlighter-rouge">inventree-data/pgdb</code> directory. We need to remove these files, as they are specific to PostgreSQL 13 and will not be compatible with PostgreSQL 17. Rather than deleting them, we will move them to a backup location, just in case we need to revert back to the old setup.</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mv data/pgdb data/pgdb_backup
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mv inventree-data/pgdb inventree-data/pgdb_backup
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>Confirm that the <code class="language-plaintext highlighter-rouge">pgdb</code> directory has been moved to the backup location before continuing to the next step. The <code class="language-plaintext highlighter-rouge">pgdb</code> directory should no longer exist in the <code class="language-plaintext highlighter-rouge">data</code> directory.</p>
|
||||
<p>Confirm that the <code class="language-plaintext highlighter-rouge">pgdb</code> directory has been moved to the backup location before continuing to the next step. The <code class="language-plaintext highlighter-rouge">pgdb</code> directory should no longer exist in the <code class="language-plaintext highlighter-rouge">inventree-data</code> directory.</p>
|
||||
|
||||
<h2 id="step-3-update-postgresql-version">Step 3. Update PostgreSQL Version</h2>
|
||||
<h2 id="step-4-update-postgresql-version">Step 4. Update PostgreSQL Version</h2>
|
||||
|
||||
<p>Next, we need to update the PostgreSQL version in the <code class="language-plaintext highlighter-rouge">docker-compose.yml</code> file. Change the version from <code class="language-plaintext highlighter-rouge">13</code> to <code class="language-plaintext highlighter-rouge">17</code>:</p>
|
||||
<p>Next, we need to update the PostgreSQL version in the <code class="language-plaintext highlighter-rouge">docker-compose.yml</code> file. Change the version from <code class="language-plaintext highlighter-rouge">postgres:13</code> to <code class="language-plaintext highlighter-rouge">postgres:17</code>:</p>
|
||||
|
||||
<p><img src="/assets/blog/db_update_new_postgres.png" alt="Update PostgreSQL version"></p>
|
||||
|
||||
@@ -161,14 +188,25 @@ docker compose down
|
||||
<p>Now we can restore the data from the backup we created previously, into the new PostgreSQL 17 database. Run the following commands:</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose up inventree-db -d
|
||||
docker compose run --rm inventree-server invoke migrate
|
||||
docker compose run --rm inventree-server invoke restore
|
||||
docker compose run --rm inventree-server psql postgresql://pguser@inventree-db:5432/inventree -f /home/inventree/data/backup/db_migrations.sql
|
||||
docker compose down
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>This will restore the database and media files from the backup we created previously.</p>
|
||||
|
||||
<h2 id="step-5-update-inventree-version">Step 5. Update InvenTree Version</h2>
|
||||
<h2 id="step-5-verify-database-update">Step 5. Verify Database Update</h2>
|
||||
|
||||
<p>Launch the InvenTree server, and confirm that you can still access your data via the web interface.</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose up -d
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>Once you have confirmed that the data is accessible, you can stop the server again:</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose down
|
||||
</code></pre></div></div>
|
||||
|
||||
<h2 id="step-6-update-inventree-version">Step 6. Update InvenTree Version</h2>
|
||||
|
||||
<p>Next, we need to update the InvenTree version in the <code class="language-plaintext highlighter-rouge">.env</code> file. Change the version from <code class="language-plaintext highlighter-rouge">1.1.12</code> to <code class="language-plaintext highlighter-rouge">1.2.0</code>:</p>
|
||||
|
||||
@@ -185,7 +223,7 @@ docker compose down
|
||||
docker compose run --rm inventree-server invoke update
|
||||
</code></pre></div></div>
|
||||
|
||||
<h2 id="step-6-verify-new-setup">Step 6. Verify New Setup</h2>
|
||||
<h2 id="step-7-verify-new-setup">Step 7. Verify New Setup</h2>
|
||||
|
||||
<p>Finally, we can start the new setup and verify that everything is working as expected.</p>
|
||||
|
||||
@@ -200,7 +238,7 @@ docker compose run --rm inventree-server invoke update
|
||||
|
||||
<p><img src="/assets/blog/db_update_docker.png" alt="Docker containers"></p>
|
||||
|
||||
<h2 id="step-7-celebrate">Step 7. Celebrate!</h2>
|
||||
<h2 id="step-8-celebrate">Step 8. Celebrate!</h2>
|
||||
|
||||
<p>Congratulations! You have successfully migrated your InvenTree installation to the latest version, with an updated PostgreSQL database. You can now enjoy the new features and improvements that come with InvenTree 1.2.0, while also benefiting from the enhanced performance and security of PostgreSQL 17.</p>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="/blog/feed.atom" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-02-18T01:58:10+00:00</updated><id>/blog/feed.atom</id><title type="html">InvenTree</title><subtitle>InvenTree is an open-source inventory management system which provides intuitive parts management and stock control. It is at the center of an ecosystem of addins for EDA tools, API wrapper, deeply integrated plugins and 3rd party tools.</subtitle><entry><title type="html">1.2.0 Release</title><link href="/blog/2026/02/12/1.2.0" rel="alternate" type="text/html" title="1.2.0 Release" /><published>2026-02-12T00:00:00+00:00</published><updated>2026-02-12T00:00:00+00:00</updated><id>/blog/2026/02/12/1.2.0</id><content type="html" xml:base="/blog/2026/02/12/1.2.0"><![CDATA[<p>The InvenTree team is excited to announce the release of version 1.2.0. Attention: This release has no support for PostgreSQL 13 - our docs contain information regading <a href="https://docs.inventree.org/en/latest/start/migrate/#migrating-between-incompatible-database-versions">PostgreSQL updates</a>. At least PostgreSQL 14 is required, we recommend PostgreSQL 18.</p>
|
||||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="/blog/feed.atom" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-02-18T23:30:12+00:00</updated><id>/blog/feed.atom</id><title type="html">InvenTree</title><subtitle>InvenTree is an open-source inventory management system which provides intuitive parts management and stock control. It is at the center of an ecosystem of addins for EDA tools, API wrapper, deeply integrated plugins and 3rd party tools.</subtitle><entry><title type="html">1.2.0 Release</title><link href="/blog/2026/02/12/1.2.0" rel="alternate" type="text/html" title="1.2.0 Release" /><published>2026-02-12T00:00:00+00:00</published><updated>2026-02-12T00:00:00+00:00</updated><id>/blog/2026/02/12/1.2.0</id><content type="html" xml:base="/blog/2026/02/12/1.2.0"><![CDATA[<p>The InvenTree team is excited to announce the release of version 1.2.0. Attention: This release has no support for PostgreSQL 13 - our docs contain information regading <a href="https://docs.inventree.org/en/latest/start/migrate/#migrating-between-incompatible-database-versions">PostgreSQL updates</a>. At least PostgreSQL 14 is required, we recommend PostgreSQL 18.</p>
|
||||
|
||||
<p>This release includes numerous new features, improvements, and bug fixes.</p>
|
||||
|
||||
@@ -111,6 +111,8 @@
|
||||
|
||||
<h2 id="migration-guide">Migration Guide</h2>
|
||||
|
||||
<p><em>Note: This procedure was updated on 2026-02-19</em></p>
|
||||
|
||||
<p>Our documentation provides a detailed <a href="https://docs.inventree.org/en/stable/start/migrate/#migrating-between-incompatible-database-versions">database migration guide</a> to assist users with this process. We recommend that users perform a backup of their database before attempting the migration, and follow the instructions carefully to ensure a smooth transition to the new database version.</p>
|
||||
|
||||
<p>Following is an example of the steps involved in migrating an InvenTree installation from a PostgreSQL 13 database to a PostgreSQL 17 database, in the context of a docker installation. The same principles apply for non-docker installations, but the particular commands may differ.</p>
|
||||
@@ -139,7 +141,24 @@
|
||||
|
||||
<p>The new installation will be running InvenTree 1.2.0 with PostgreSQL 17</p>
|
||||
|
||||
<h2 id="step-1-perform-backup">Step 1. Perform Backup</h2>
|
||||
<h3 id="data-backup">Data Backup</h3>
|
||||
|
||||
<p>It is prudent to perform a regular backup of the database, before following the migration procedure. This can be done using the <code class="language-plaintext highlighter-rouge">invoke backup</code> command, as described in the documentation. This will create a backup of the database and media files in the <code class="language-plaintext highlighter-rouge">data/backup</code> directory.</p>
|
||||
|
||||
<h2 id="step-1-ensure-starting-conditions-are-met">Step 1. Ensure Starting Conditions are Met</h2>
|
||||
|
||||
<ul>
|
||||
<li><code class="language-plaintext highlighter-rouge">postgres:13</code> is set in <code class="language-plaintext highlighter-rouge">docker-compose.yml</code></li>
|
||||
<li><code class="language-plaintext highlighter-rouge">INVENTREE_VERSION=1.1.12</code> is set in <code class="language-plaintext highlighter-rouge">.env</code></li>
|
||||
<li>Database schema has been updated to the latest version:</li>
|
||||
</ul>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose up inventree-db -d
|
||||
docker compose run --rm inventree-server invoke update
|
||||
docker compose down
|
||||
</code></pre></div></div>
|
||||
|
||||
<h2 id="step-2-perform-manual-backup">Step 2. Perform Manual Backup</h2>
|
||||
|
||||
<p>The first step is to perform a backup of the existing database. This step must be performed with the old setup (postgres 13 / InvenTree 1.1.12), before we perform any updates to the software.</p>
|
||||
|
||||
@@ -150,26 +169,30 @@
|
||||
<p>To perform the backup, we run the following commands:</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose up inventree-db -d
|
||||
docker compose run --rm inventree-server invoke backup
|
||||
docker compose run --rm inventree-server pg_dump postgresql://pguser@inventree-db:5432/inventree -f /home/inventree/data/backup/db_migrations.sql
|
||||
docker compose down
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>This will create a backup of the database and media files in the <code class="language-plaintext highlighter-rouge">data/backup</code> directory.</p>
|
||||
<p><em>Note: You will be prompted for the password for the <code class="language-plaintext highlighter-rouge">pguser</code> user. This is the password that you set in the <code class="language-plaintext highlighter-rouge">.env</code> file (default is <code class="language-plaintext highlighter-rouge">pgpassword</code>).</em></p>
|
||||
|
||||
<p><em>Note: Do not change the path to the migrations file, this is the internal docker container path, and should not be changed.</em></p>
|
||||
|
||||
<p>This will create a backup of the database and media files in the <code class="language-plaintext highlighter-rouge">inventree-data/backup</code> directory (external to the docker containers). The database backup will be saved as <code class="language-plaintext highlighter-rouge">db_migrations.sql</code>.</p>
|
||||
|
||||
<p>Confirm that the backup files have been created before continuing to the next step.</p>
|
||||
|
||||
<h2 id="step-2-move-database-directory">Step 2. Move Database Directory</h2>
|
||||
<h2 id="step-3-move-database-directory">Step 3. Move Database Directory</h2>
|
||||
|
||||
<p>The PostgreSQL database files are stored in the <code class="language-plaintext highlighter-rouge">data/pgdb</code> directory. We need to remove these files, as they are specific to PostgreSQL 13 and will not be compatible with PostgreSQL 17. Rather than deleting them, we will move them to a backup location, just in case we need to revert back to the old setup.</p>
|
||||
<p>The PostgreSQL database files are stored in the <code class="language-plaintext highlighter-rouge">inventree-data/pgdb</code> directory. We need to remove these files, as they are specific to PostgreSQL 13 and will not be compatible with PostgreSQL 17. Rather than deleting them, we will move them to a backup location, just in case we need to revert back to the old setup.</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mv data/pgdb data/pgdb_backup
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mv inventree-data/pgdb inventree-data/pgdb_backup
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>Confirm that the <code class="language-plaintext highlighter-rouge">pgdb</code> directory has been moved to the backup location before continuing to the next step. The <code class="language-plaintext highlighter-rouge">pgdb</code> directory should no longer exist in the <code class="language-plaintext highlighter-rouge">data</code> directory.</p>
|
||||
<p>Confirm that the <code class="language-plaintext highlighter-rouge">pgdb</code> directory has been moved to the backup location before continuing to the next step. The <code class="language-plaintext highlighter-rouge">pgdb</code> directory should no longer exist in the <code class="language-plaintext highlighter-rouge">inventree-data</code> directory.</p>
|
||||
|
||||
<h2 id="step-3-update-postgresql-version">Step 3. Update PostgreSQL Version</h2>
|
||||
<h2 id="step-4-update-postgresql-version">Step 4. Update PostgreSQL Version</h2>
|
||||
|
||||
<p>Next, we need to update the PostgreSQL version in the <code class="language-plaintext highlighter-rouge">docker-compose.yml</code> file. Change the version from <code class="language-plaintext highlighter-rouge">13</code> to <code class="language-plaintext highlighter-rouge">17</code>:</p>
|
||||
<p>Next, we need to update the PostgreSQL version in the <code class="language-plaintext highlighter-rouge">docker-compose.yml</code> file. Change the version from <code class="language-plaintext highlighter-rouge">postgres:13</code> to <code class="language-plaintext highlighter-rouge">postgres:17</code>:</p>
|
||||
|
||||
<p><img src="/assets/blog/db_update_new_postgres.png" alt="Update PostgreSQL version" /></p>
|
||||
|
||||
@@ -183,14 +206,25 @@ docker compose down
|
||||
<p>Now we can restore the data from the backup we created previously, into the new PostgreSQL 17 database. Run the following commands:</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose up inventree-db -d
|
||||
docker compose run --rm inventree-server invoke migrate
|
||||
docker compose run --rm inventree-server invoke restore
|
||||
docker compose run --rm inventree-server psql postgresql://pguser@inventree-db:5432/inventree -f /home/inventree/data/backup/db_migrations.sql
|
||||
docker compose down
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>This will restore the database and media files from the backup we created previously.</p>
|
||||
|
||||
<h2 id="step-5-update-inventree-version">Step 5. Update InvenTree Version</h2>
|
||||
<h2 id="step-5-verify-database-update">Step 5. Verify Database Update</h2>
|
||||
|
||||
<p>Launch the InvenTree server, and confirm that you can still access your data via the web interface.</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose up -d
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>Once you have confirmed that the data is accessible, you can stop the server again:</p>
|
||||
|
||||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose down
|
||||
</code></pre></div></div>
|
||||
|
||||
<h2 id="step-6-update-inventree-version">Step 6. Update InvenTree Version</h2>
|
||||
|
||||
<p>Next, we need to update the InvenTree version in the <code class="language-plaintext highlighter-rouge">.env</code> file. Change the version from <code class="language-plaintext highlighter-rouge">1.1.12</code> to <code class="language-plaintext highlighter-rouge">1.2.0</code>:</p>
|
||||
|
||||
@@ -207,7 +241,7 @@ docker compose down
|
||||
docker compose run --rm inventree-server invoke update
|
||||
</code></pre></div></div>
|
||||
|
||||
<h2 id="step-6-verify-new-setup">Step 6. Verify New Setup</h2>
|
||||
<h2 id="step-7-verify-new-setup">Step 7. Verify New Setup</h2>
|
||||
|
||||
<p>Finally, we can start the new setup and verify that everything is working as expected.</p>
|
||||
|
||||
@@ -222,7 +256,7 @@ docker compose run --rm inventree-server invoke update
|
||||
|
||||
<p><img src="/assets/blog/db_update_docker.png" alt="Docker containers" /></p>
|
||||
|
||||
<h2 id="step-7-celebrate">Step 7. Celebrate!</h2>
|
||||
<h2 id="step-8-celebrate">Step 8. Celebrate!</h2>
|
||||
|
||||
<p>Congratulations! You have successfully migrated your InvenTree installation to the latest version, with an updated PostgreSQL database. You can now enjoy the new features and improvements that come with InvenTree 1.2.0, while also benefiting from the enhanced performance and security of PostgreSQL 17.</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user