Backup/restore or migration?

Hi community! I need to migrate a Zammad instance from a server to another server, both with Ubuntu 16.04 server and Zammad 2.4 (installed from repostiroy with apt-get). I tried to do this through the functionality of backup/restore, but when I restore the last backup on new server, restore script return this:

./zammad_restore.sh: line 39: ammad: command not found

# Zammad restored successfully - Fri Apr  6 23:39:52 CEST 2018!

and Zammad dont’s start correctly. In /var/log/syslog I see this errors:

Apr  6 23:41:27 dmz-hk03 zammad-web-1.service[9786]:   /opt/zammad/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
Apr  6 23:41:27 dmz-hk03 zammad-web-1.service[9786]:   /opt/zammad/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
Apr  6 23:41:27 dmz-hk03 zammad-web-1.service[9786]:   script/rails:6:in `require'
Apr  6 23:41:27 dmz-hk03 zammad-web-1.service[9786]:   script/rails:6:in `<top (required)>'
Apr  6 23:41:27 dmz-hk03 systemd[1]: zammad-web-1.service: Main process exited, code=exited, status=1/FAILURE
Apr  6 23:41:27 dmz-hk03 systemd[1]: zammad-web-1.service: Unit entered failed state.
Apr  6 23:41:27 dmz-hk03 systemd[1]: zammad-web-1.service: Failed with result 'exit-code'.
Apr  6 23:41:28 dmz-hk03 zammad-worker-1.service[9785]: bundler: failed to load command: script/scheduler.rb (script/scheduler.rb)
Apr  6 23:41:28 dmz-hk03 zammad-worker-1.service[9785]: TypeError: Zendesk is not a class

Is there a good way to migrate Zammad from one server to another?

Thank you very much!

“./zammad_restore.sh: line 39: ammad: command not found”

Have you checked the given line, fixed it and tried it again?

mmm… I dont’ see errors in the script:

#!/bin/bash

zammad restore script

PATH=/sbin:/bin:/usr/sbin:/usr/bin:
BACKUP_SCRIPT_PATH="$(dirname $(realpath $0))"

if [ -f “${BACKUP_SCRIPT_PATH}/config” ]; then

import config

. ${BACKUP_SCRIPT_PATH}/config
else
echo -e “\n The ‘config’ file is missing!”
echo -e " Please copy ${BACKUP_SCRIPT_PATH}/config.dist to ${BACKUP_SCRIPT_PATH}/config before running $0!\n"
exit 1
fi

import functions

. ${BACKUP_SCRIPT_PATH}/functions

exec restore

start_restore_message

get_zammad_dir

restore_warning “${1}”

check_database_config_exists

get_restore_dates

choose_restore_date “${1}”

detect_initcmd

stop_zammad

restore_zammad
### HERE IS LINE 39
start_zammad

finished_restore_message

try running the restore script with bash -x

bash -x zammad_restore.sh

it will print out extra info about what bash is doing. but the error you pasted is pretty clear, it’s trying to run a command called ammad. Is what you pasted above the contents of zammad_restore.sh on the server you’re running it on? ie it’s not a copy from a git repo or whatever?

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