Restoring a database while phones keep uploading is asking for a mess. Immich has a maintenance mode for this kind of job, and you can switch it from the shell.
Turn it on from the server container:
docker exec -it immich_server immich-admin enable-maintenance-mode
Maintenance mode uses its own login. The server log prints a line saying Immich is in maintenance mode, followed by a URL to log in with, so fetch it from the log:
docker logs immich_server 2>&1 | grep -i -A2 "maintenance mode"
Open that address, do your work, and when you’re done:
docker exec -it immich_server immich-admin disable-maintenance-mode
If you lost the URL, running the enable command again gives you a new one. The same switch also exists in the web interface under the administration pages, on the Maintenance tab, but the command line version is what I’d use when the web UI itself is part of the problem.
Treat the login URL like a password, because it grants access to restore functions. Don’t paste your log into a chat or issue without removing it.
Tell the family first. Their apps will show errors while the server is in this state, and a short message beats a worried phone call about disappearing photos.
Further reading: Immich maintenance mode, Immich server commands
Going deeper: Guide: link Prowlarr to Sonarr and Radarr once, and stop typing indexers into every app