mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	docs: Add DB name to backup-and-restore (#13244)
* Update backup-and-restore.md changelog: Add database name to the restore command and document it in the notes * docs: remove added database flag and change warn wording * docs: fix forgotten warning change Co-authored-by: Matthew Momjian <50788000+mmomjian@users.noreply.github.com> --------- Co-authored-by: Matthew Momjian <50788000+mmomjian@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									f7ad6efc4a
								
							
						
					
					
						commit
						1a72602ff9
					
				@ -38,6 +38,7 @@ docker compose pull     # Update to latest version of Immich (if desired)
 | 
			
		||||
docker compose create           # Create Docker containers for Immich apps without running them
 | 
			
		||||
docker start immich_postgres    # Start Postgres server
 | 
			
		||||
sleep 10                        # Wait for Postgres server to start up
 | 
			
		||||
# Check the database user if you deviated from the default
 | 
			
		||||
gunzip < "/path/to/backup/dump.sql.gz" \
 | 
			
		||||
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
 | 
			
		||||
| docker exec -i immich_postgres psql --username=postgres  # Restore Backup
 | 
			
		||||
@ -59,6 +60,7 @@ docker compose pull     # Update to latest version of Immich (if desired)
 | 
			
		||||
docker compose create           # Create Docker containers for Immich apps without running them
 | 
			
		||||
docker start immich_postgres    # Start Postgres server
 | 
			
		||||
sleep 10                        # Wait for Postgres server to start up
 | 
			
		||||
# Check the database user if you deviated from the default
 | 
			
		||||
gc "C:\path\to\backup\dump.sql" | docker exec -i immich_postgres psql --username=postgres  # Restore Backup
 | 
			
		||||
docker compose up -d            # Start remainder of Immich apps
 | 
			
		||||
```
 | 
			
		||||
@ -103,6 +105,7 @@ services:
 | 
			
		||||
Then you can restore with the same command but pointed at the latest dump.
 | 
			
		||||
 | 
			
		||||
```bash title='Automated Restore'
 | 
			
		||||
# Be sure to check the username if you changed it from default
 | 
			
		||||
gunzip < db_dumps/last/immich-latest.sql.gz \
 | 
			
		||||
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
 | 
			
		||||
| docker exec -i immich_postgres psql --username=postgres
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user