Migrating Zammad environment to new server

Hey,

In the short term, we want to move the current Zammad installation running on CentOS7 to a new server / provider.

Here we have 2 options:

  • migrate to a new CentOS7 environment and restore the environment through backup / restore;
  • migrate to a new Ubuntu environment.

I am curious about the opinion of others? Is a migration to Ubuntu doable? Or is the advise not to do so when coming from CentOS7? And what is the advice to transfer data then?

Like to hear!

  • Used Zammad version: 2.5.x

Kind regards,

Mark

Hi Mark,

I would suggest you contact sales@zammad.com … No just kidding.
You could do it this way:

  1. Stop all Zammad services and check if they are inactive (may take some time)
  2. Create a postgresql/MySQL/MariaDB Dump which contains your Zammad
  3. Install Zammad, same patchlevel as on the old system
  4. Install and configure Database and Webserver
  5. Import your dump
  6. Modify your /opt/zammad/config/database.yml to macht the new settings (user&pass)
  7. Restart all the services

You can also use our backup script, I prefer to do it manually.

Those steps are “universal” you could transfer Zammad to any OS (except Windows). Which OS you use is totally up to you. We use CentOS and have no issues.

regards

EDIT:
And when you are done with the migration itself, you can update to the latest Zammad using apt / yum.

1 Like

Why not upgrade before migrating? just wondering cause I think its easier to download a fresh updated copy of Zammad to install on the new system than find the exact same version of the system you are currently running.

Hi,

you could, this would be no problem. I read the question that he is not able to upgrade before the transfer, thats the only reason.

regards

1 Like

Hi all,

Thank you for the responses, good to know in advance that there won’t be any “complexity” to be awaited when migrating. In the way with upgrading both OS and Zammad first would sound logical to me also. We have the possibility to upgrade first, no problem there.

At this moment we are using CentOS. No problems there also, but since we are also using some software packages that runs mandatory on Ubuntu or at least are better supported on Ubuntu, we are now examine the possibilities to run the other systems also on Ubuntu.

I will try to do a test migration later on next week, true the steps Hannes described. W’ll keep u posted on my findings and outcome on that :slight_smile:

Thanks!!

Hi all,

Unfortunately the first experiences wit migrating didn’t made happy so far. After restoring the database on the new environment some things are not function normally.

What I did:

Steps 1 till 5, at which I import the .psql dump that I’ve exracted from the back-up file. That way I even do not have to change the database.yml file, since nothing did change.

The weird thing is however, that when I’ve tried to login i can’t. When logging in into a user account I can login, and I can see the overviews and tickets that are belonging to that account. When loggin in into an admin / agent account however I’ve receive a white screen.

Do you guys have any idea what this could be? How this could be solved?

Little sidenote: I also tried to move the database and settings by using the back-up and restore script. That however resolved in a server with a lot of 502 page not found error pages, and a lot of information being written into the log files (a lot of errors). For a CentOS to Ubuntu migration, that is not a good solution, or I am doing something terrible wrong.

Kind regards,

Mark

Hi @mbpws,

sad to hear this :confused: Can you provide the steps you did?
As I wrote before it’s usually pretty simple:

  • stop all services
  • perform the dump
  • move the dump to the new system
  • move attachments to the new system, if they are stored in the new system
  • install Zammad on the new OS -> Don’t start the services
  • import the postgresql dump
  • if your Zammad versions did not match perform zammad run rake db:migrate
  • start the services
  • login as usual

Please check if you missed some of the points, you can also send the log to support@znuny.com and I will have a look.

Regards
Johannes

Hi Hannes,

Wel this definitely clear some things up :wink: At the step: Install Zammad on the new OS -> I missed the “Don’t start the services”. Actually, since I use Ubuntu, this seems to be something that cannot be ‘skipped’ since the installer wil start the services automatically after finishing the installation.

At the moment I’m downloading all attachments again to the new server. Importing the database failed unfortunately, got a lot of errors of duplicate records (see below). So that’s a new one to figure out… :frowning:

setval

15139
(1 row)

ERROR: duplicate key value violates unique constraint “store_objects_pkey”
DETAIL: Key (id)=(1) already exists.
CONTEXT: COPY store_objects, line 1
setval

and erros like these:

ERROR: constraint “fk_rails_e85422db7e” for relation “roles” already exists
or these
ERROR: multiple primary keys for table “ticket_counters” are not allowed

When I migrated by private instance from A to B I simply used the provided backup script.
Stopped Zammad on Host A, ran the Backup-Script and transfered it to Host B.
I then installed Zammad there (it got automatically started), stopped Zammad on Host B and restored the backup via provided script.

Had no trouble with that.
In your case it looks like the database hasn’t been dropped.

Hi all,

In the meantime I managed to get it working. I already figured out that the migration from CentOS7 to Ubuntu will not work when using the provided backup script. It will throw errors all over.

In the end I’ve got it working by following the steps Johannes provided. The problems with restoring the database got covered by making a complete dump of the database on the CentOS7 environment with the function pg-dump. Restoring the database succeeded when giing a couple of extra parameters to truncate the database first.

Making the dump

pg_dump -Fc mydb > db.dump

Restoring the database

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d my_db db/latest.dump

I needed to restore the dump as the postgresql zammad user.

After that everything works like a charm.

Thanks for the provided support.

2 Likes

Thanks for the feedback, glad you could address your issue!

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