Helm chart restore from dump

  • Used Zammad version: helm chart 10.0.0 (zammad latest 6.x)
  • Used Zammad installation type: (source, package, docker-compose, …) helm
  • Operating system: k8s
  • Browser + version: -

Expected behavior:

Clean install and restore from backup dump

Actual behavior:

Clean Install without any issues, but problems with restoring (official documentations doesn’t help me)

Steps to reproduce the behavior:

  • connect to railserver container inside pod.
  • upload dump to shared mount /opt/zammad/storage
  • mv config.dist config
  • update backup location
  • update db adapter in database.yaml
~/contrib/backup$ ./zammad_db_user_helper.sh 

 # This helper script sets the current Zammad user password on your postgresql server.
 # WARNING: THIS SCRIPT CHANGES CREDENTIALS, DO NOT CONTINUE IF YOU DON'T KNOW WHAT YOU'RE DOING! 


 Limitations:
 - only works for local postgresql installations
 - only works for postgresql

Enter 'yes' if you want to proceed!
ALTER zammad users password?: yes
# Stopping Zammad
zammad: unrecognized service


 # WARNING: You don't seem to have administrative permissions!
 #-> This may be fine if you're on a source code installation.
 #-> Please ensure that Zammad is NOT running - otherwise restore will FAIL.

# Found an empty password - I'll be fixing this for you ...
# ... Fixing permission database.yml
You don't seem to be using a local PostgreSQL installation.
This script does not support your installation. No changes were done.
# Starting Zammad
zammad: unrecognized service

then i run restore script

~/contrib/backup$ ./zammad_restore.sh 

# Zammad restore started - Fri Sep 29 15:07:41 UTC 2023!

The restore will delete your current database! 
Be sure to have a backup available! 

Please ensure to have twice the storage of the uncompressed backup size! 


Note that the restoration USUALLY requires root permissions as services are stopped! 


Enter 'yes' if you want to proceed!
Restore?: yes
Enter file date to restore: 
20230917171046
File date: 20230917171046
Enter db date to restore: 
20230917171046
DB date: 20230917171046
# Stopping Zammad
zammad: unrecognized service


 # WARNING: You don't seem to have administrative permissions!
 #-> This may be fine if you're on a source code installation.
 #-> Please ensure that Zammad is NOT running - otherwise restore will FAIL.

# Restoring Files
tar: opt/zammad/tmp: Cannot utime: Operation not permitted
tar: opt/zammad/tmp: Cannot change mode to rwxr-xr-x: Operation not permitted
tar: Exiting with failure status due to previous errors
# ERROR(2) - File restore reported an error.
- Check file permissions, and ensure Zammad IS NOT running, and try again.
 
# RESTORE WAS NOT SUCCESSFUL

type or paste code here

type or paste code here

i tried on different containers (nginx, scheduler, websocket) but same issues.

If someone have solution with restoring in helm please give me correct way.

here is output from nginx container:

./contrib/backup/zammad_restore.sh 

# Zammad restore started - Fri Sep 29 15:13:54 UTC 2023!

The restore will delete your current database! 
Be sure to have a backup available! 

Please ensure to have twice the storage of the uncompressed backup size! 


Note that the restoration USUALLY requires root permissions as services are stopped! 


Enter 'yes' if you want to proceed!
Restore?: yes
Enter file date to restore: 
20230917171046
File date: 20230917171046
Enter db date to restore: 
20230917171046
DB date: 20230917171046
# Stopping Zammad
zammad: unrecognized service


 # WARNING: You don't seem to have administrative permissions!
 #-> This may be fine if you're on a source code installation.
 #-> Please ensure that Zammad is NOT running - otherwise restore will FAIL.

# Restoring Files
# Ensuring correct file permissions ...
# Checking requirements
# ... Dropping current database zammad_production
Your Ruby version is 3.1.3, but your Gemfile specified 3.0.4
# ... Creating database zammad_production for owner postgres
Your Ruby version is 3.1.3, but your Gemfile specified 3.0.4
# Restoring PostgreSQL DB
/opt/zammad/contrib/backup/functions: line 407: psql: command not found
# Clearing Cache ...
Your Ruby version is 3.1.3, but your Gemfile specified 3.0.4
# Starting Zammad
zammad: unrecognized service

# Zammad restored successfully - Fri Sep 29 15:14:55 UTC 2023!

looks like files is restored, but postgres no

I’m afraid the restore script is not exactly supporting docker.
I tried several times to unify the backup and restore script with docker - but the docker one uses a custom backup script…

I’d suggest to manually restore the database against the postgresql container. If you need you’ll also have to copy the tar files storage folder into your environment. If you have your attachments inside the database you technically can ignore that file system entirely.

This topic was automatically closed 360 days after the last reply. New replies are no longer allowed.