Skip to content

fix(docs): Windows backup script #13091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

fix(docs): Windows backup script #13091

wants to merge 2 commits into from

Conversation

aviv926
Copy link
Collaborator

@aviv926 aviv926 commented Oct 1, 2024

The method shown in the Immich documents for backing up on Windows does not work well and it does not properly back up city names in languages ​​other than English.

Cities in Hebrew and Arabic languages ​​would appear as ┘ו╪»┘ך┘ז╪⌐ ╪¿┘ז┘ך ┘ך╪º╪│and caused problems after restoring from a backup.

A solution to this problem is to backup directly from the Docker container and then copy the file to Windows.

The script will create a folder named Immich DB backups on the desktop where a file named immich_dump.sql.gz will be stored.

It's important for me to say, I'm not a big expert in PS that's why I used artificial intelligence to write this script, it works well and does the job properly.

I will understand if you don't want to include it in the documentation, however if we don't include it we will have to remove the option of backing up the database in Windows and instead put a link to the gits I created or link it to the Community Guides, or find a way to back up the database properly , as you see fit :)

demo.mp4

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 1, 2024
@bo0tzz
Copy link
Member

bo0tzz commented Oct 1, 2024

I don't really understand the issue

A solution to this problem is to backup directly from the Docker container and then copy the file to Windows.

As far as I can tell the existing setup already runs the pg dump inside of the container.

@aviv926
Copy link
Collaborator Author

aviv926 commented Oct 1, 2024

I don't really understand the issue

A solution to this problem is to backup directly from the Docker container and then copy the file to Windows.

As far as I can tell the existing setup already runs the pg dump inside of the container.

From an experiment I did when I ran the script:
docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgres | Set-Content -Encoding utf8 "C:\path\to\backup\dump.sql"

This returned a file with the names of the cities in Hebrew and Arabic corrupted, in addition even if a user uses an external directory with paths that contain Hebrew or Arabic characters it corrupts them.

This is how it looks:
image

I tried to figure out if the problem is related to Set-Content -Encoding utf8 but I couldn't get it to work even when I changed it to Windows-1256 for Arabic or Windows-1255 for Hebrew.

Only when I ran inside the docker container the backup command
pg_dumpall --clean --if-exists --username=postgres | gzip > "/path/to/backup/dump.sql.gz"

And I checked the backup content, it displayed the Hebrew and Arabic letters correctly.

This is how it should look:
image

@zackpollard
Copy link
Contributor

Hey, we have chatted about this and since we now have backups integrated into the server itself, we don't think this is needed. It would be better to update the restore section to refer to those integrated backups. If you want to add a guide for windows manual backups, lets make that a community guide that we can link out to and we can convert the manual backup section here to point to the integrated automatic backups.

@zackpollard zackpollard closed this Mar 3, 2025
@aviv926
Copy link
Collaborator Author

aviv926 commented Mar 3, 2025

Hey, we have chatted about this and since we now have backups integrated into the server itself, we don't think this is needed. It would be better to update the restore section to refer to those integrated backups. If you want to add a guide for windows manual backups, lets make that a community guide that we can link out to and we can convert the manual backup section here to point to the integrated automatic backups.

Hi Zack how are you? Thanks, yes this PR is no longer needed for the reasons you mentioned and I think it's good that it is because now it is a feature added to the code so it will get updates accordingly and avoid future problems. I believe I will update the documentation to explain about the new feature the team added (thanks for that! As always 0:) By the way, you can check with the team about #14911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:documentation documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants