Zammad database restore can't find db.psql.gz

  • Used Zammad version: 4.0
  • Used Zammad installation type: source
  • Operating system: ubuntu lts 20.04
  • Browser + version: firefox 111

Expected behavior:

Zammad database restore script should restore files and database.

Actual behavior:

Restore script can find the files backup but not the database backup and restore fails.

Steps to reproduce the behavior:

Do a Zammad backup on server1 with the provided backup script.
Copy the backup to server2, same directory /var/tmp/.
Start the restore with the provided backup script.

We are migrating from server1 to server2 because of unsuccessful attempts to update zammad to 5.0. We’ve set up a server2 with the same OS and installed Zammad 4.0 from source (we’ve used the migration guide). It’s a fresh install. The Zammad webservice is accessible, but the system isn’t configured yet.
A Zammad restore on an ubuntu lts 22.04 server with zammad 5.0 newly installed was finding the db backup file (but the restore was failing with other errors, not part of this ticket).

When trying to restore the backup file, following output is produced:

root@ticket:/opt/zammad/contrib/backup# ./zammad_restore.sh

# Zammad restored started - Fri Mar 24 08:14:19 UTC 2023!

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

Enter 'yes' if you want to proceed!
Restore?: yes
adapter=postgresql
mysql2
postgresql dbname=zammad
zammad_development
zammad_test dbuser=zammad
zammad
zammad dbpass=
<Password>
mypasswordhere
Enter file date to restore:
20230322083347
20230323163618
20230323163909
File date: 20230322083347
Enter db date to restore:

DB date:
File /var/tmp/zammad_backup/_zammad_db..gz does not exist!
Restore aborted!

The database.yml file looks like this (as the functions file reads out the db_adapter which should be psql, but the file is not found):

production:
  adapter: postgresql
  database: zammad
  pool: 50
  timeout: 5000
  encoding: utf8
  username: zammad
  password: mypasswordhere

The backup files are:

drwxr-xr-x 2 root     pbg-admin       4096 Mar 23 16:39 .
drwxrwxrwt 8 root     root            4096 Mar 24 02:00 ..
-rw-rw-r-- 1 postgres postgres    60553259 Mar 22 08:58 20230322083347_zammad_db.psql.gz
-rwxr-xr-x 1 root     root      1515064312 Mar 22 08:57 20230322083347_zammad_files.tar.gz
-rw-r--r-- 1 root     root        27629774 Mar 23 16:36 20230323163618_zammad_files.tar.gz
-rw-r--r-- 1 root     root        27629827 Mar 23 16:39 20230323163909_zammad_files.tar.gz
-rwxr-xr-x 1 root     pbg-admin   60553259 Mar 22 08:58 latest_zammad_db.psql.gz
lrwxrwxrwx 1 root     root              57 Mar 23 16:39 latest_zammad_files.tar.gz -> /var/tmp/zammad_backup/20230323163909_zammad_files.tar.gz

I did some testing, which is why there are several files.

Many thanks in advance.

Update: Restore script found the database backup files after editing the database.yml file. Following debug information gave me a hint it was the database configuration file:

adapter=postgresql
mysql2
postgresql dbname=zammad
zammad_development
zammad_test dbuser=zammad
zammad
zammad dbpass=
<Password>
mypasswordhere

Restore script found several database connectors because it didn’t take commennts into account.

The restore was successfull. I now have to figure out why zammad isn’t reachable and nginx shows error, but this will be another case.

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