How to Move Mautic to Another Server

Written by
Outer
on September 21, 2018

So you have Mautic running on your web server along with your website, but now you need to move Mautic along with your website to a new server? Good news! Migrating Mautic to another server is a walk in the park.

The instructions below are going to show you how to dump the mysql database from the command line in Debian/Ubuntu, import to a new db and migrate your Mautic installation. Let’s get to it!

Export Your MySQL Database

Assuming the name of your database is ‘mymautic’ and your username is ‘henry’ type the following at the command line:

mysqldump -u henry -p mymautic > whateveryouwant.sql

The – u signifies ‘username’ and the -p signifies ‘password’ which you’ll be prompted for after entering in the above. The contents of your database will now be in the ‘whateveryouwant.sql’ file, and that will most likely be in your server /root/ directory. Not the server root, but the ‘root’ directory — That tripped me up in the past!

Create New Database & User

Create a new database on the new server. Sign into MySQL:

mysql -u root -p

Then type in the following, assuming you’re going to use the same db name and user name as above (you don’t have to):

create database;

And to grant access:

grant all on mymautic.* to ‘henry’ identified by ‘put-a-tough-password-here’;

Be sure to actually use the single quotes in the command above. Now you’re ready to import.

Import to New Database

It’s time to import. Copy the ‘whateveryouwant.sql’ file to the same /root/ directory on the new server. Then type:

mysql -u henry -p -h localhost mymautic < whateveryouwant.sql

Copy Mautic Files

Nice! The hardest part of your Mautic migration is done. Now copy your Mautic sub folder to the same place on your new server. Once the copy is finished, make sure www-data has proper rights. Assuming Mautic is contained in a ‘content’ folder, type in the following:

chown -R www-data:www-data /var/www/yoursite.com/public_html/content/

Your Mautic migration is almost done!

Edit Config File & Clear Cache

Open the /content/app/config/local.php file and update the database name, user and password (if different). Then delete the /content/app/cache folder.

Make sure your nginx server block file is configured to look in the right folder and you’re ready to go. See installing Mautic in a subfolder for more information.

That’s it! As promised, moving Mautic to another server is a walk in the park!

 

Would you like us to send you the latest?
[contact-form-7 404 "Not Found"]

2 thoughts on “How to Move Mautic to Another Server

  1. You my also need update the local.php file configuration to update the path of the site on the new server. (Cache dir, logs dir….)

Leave a Reply

Your email address will not be published. Required fields are marked *

Upload your logo here. If you don't have a logo, you can create a simple one for free at the following site: https://logomakr.com/. We have a video in OGU that talks about creating a logo. It's a short video, so if you're new to logos, we recommend you check it out. Have fun!

This allows you to place an image or solid color underneath your home page logo and menu. See an example of this type of layout at followhook.com.

If you would like to change the background color of your site, you can do that here! If you want to set it back to the default color, the color code is #FFFFFF.

Optional: only change this if you don't like the default. You can enter any manual pixel setting in here (ie 1200px) or you can enter 100% for a full width top.

This will add space on the left side. Normally you don't need space on the left, but in case you do, this is the place! The setting is in pixels. The default is '0.'

This adds space on the top, above your logo. The default is 15.

This will add space on the right side. Normally you don't need space on the right, but in case you do, this is the place! The setting is in pixels. The default is '0.'

This adds space on the bottom, below your logo. The default is 15.

This defines how wide your logo is. This setting is in pixels.

px

When using the wide navigation, you can opt to have your logo centered or left aligned. *Note: if using a top search field, you can only left-align.

This defines how wide your logo is on a tablet in wide view (varies by device).

%

This defines how wide your logo is on a tablet in normal view (varies by device).

%

This defines how wide your logo is on a normal sized mobile phone in normal view (varies by device). The setting is a percentage.

%

This defines how wide your logo is on a large mobile phone in normal view (varies by device). The setting is a percentage.

%

This will position the top of your site at the top at all times, even with scrolling. *Note: This only works with the small menu setting.

Choose a color for the border.

This setting is in pixels. We recommend 1.

When you visit a website, your browser tab shows a tiny icon for the site. If you're not sure on this, go visit http://outergain.com and you'll see ours. You can upload an image for your site's favicon here. *Note: you must use a square image and the image type must be a PNG. If you use a JPG or GIF it may not work. Please visit http://support.outergain.com if you have questions.

This will place a search form on the top right of your site for computer screens only. *Note: You will need to adjust the 'Navigation Top Margin' of your menu under 'Site Menu' or the search field will appear directly behind the navigation.

Change to zero for no border.

Choose the background color for the footer form field. The default is #FFFFFF.

Choose the background color for the footer form button. The default is #AAAAAA.

Choose the background color for the footer form button with mouseover.

Choose the font color for the footer form button. The default is #444444.

This is the size of the font on the button. The setting is in pixels.

This sets the spacing in pixels above the search form.

px

This sets the spacing in pixels to the right of the search form.

px





Do NOT follow this link or you will be banned from the site!