This tutorial explains how to migrate to WordPress from various CMS on a Mac MAMP server.
The same tutorial can be used to migrate:
- Joomla to WordPress
- Drupal to WordPress
- Magento to WooCommerce
- PrestaShop to WooCommerce
- SPIP to WordPress
Files you will need for the migration:
- MAMP for Mac -> https://www.mamp.info/en/downloads/
- WordPress -> https://wordpress.org/download/
- and of course the corresponding FG Plugin xxx to WordPress https://www.fredericgilles.net/
Preparing the Mac for the migration to WordPress
Double click the downloaded MAMP file and proceed with the installation by clicking continue and install at all prompts
Go to your Applications folder and open the MAMP folder.
While holding the Control button on your keyboard, click the MAMP icon and click open.
You should see the MAMP window open:
Then click on Start servers
Now we need to make MAMP to use the default ports.
To do this click stop servers:
and at preferences:
Go to ports
and click “Set web and mysql ports to 80 & 3306”
and click ok
Enter your password and the servers should restart.
Do not worry if you get an error message.
At this point restart your whole mac.
When you come back run MAMP again if it is not already running and click to start the servers if they are not already running.
Setting up the Macintosh, Apache, MySQL and PHP server aka MAMP
To migrate to WordPress from another CMS you will need to setup the server first. To do this please open the terminal by going to the spotlight and type “terminal”.
We want to add a new domain for our migration.
To add the migration domain open the hosts file via the terminal with the command:
sudo nano /etc/hosts
Press enter, enter your password and an editor will open
at the editor enter:
127.0.0.1 wordpress.test
and to save press control + O
to exit press control + X
We need to edit a few more files before we can start (you do not need to enter sudo)
nano /Applications/MAMP/conf/apache/httpd.conf
using your pagedown key go to the “almost” end of the file and find the commented line (commented lines are the ones which start with a #)
#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
and remove the # to become
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
Then add this line below it:
Timeout 7200
to save press control + O
to exit press control + X
Then we will need to edit the file we just uncommented.
nano /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
at this step we decide where we want to put our website in our mac
to avoid any permissions issue, we will use our user’s folder for this.
We recommend creating a www folder inside the user’s home folder and create a second folder with the same name as our migration domain for the migration of our website
Click Finder -> GO -> Home
right click to create a new folder and name it www
Then enter www and create a new folder wordpress.test
now we need to add this at our vhosts.conf file
go back at the terminal window and select – copy – paste one of the <virtualhost> blocks. You can select it with your mouse, right click on the selected text, move the cursor with the arrows on your keyboard at the end, right click, paste
First delete the lines we do not need
Delete the lines that start with ServerAdmin, ErrorLog, CustomLog
You should have this:
Then we need to edit the rest of the lines
The DocumentRoot should point to our newly created folders.
this is /Users/YOUR USERNAME/www/wordpress.test
to find the exact “YOUR USERNAME” at the finder window click “Go” and then click “Computer”
inside the Users folder there should be a house icon. The name of that house icon is the “YOUR USERNAME”. In our case simply user.
Go back to the terminal and replace the DocumentRoot line from
DocumentRoot “/Applications/MAMP/Library/docs/dummy-host2.example.com”
to
DocumentRoot “/Users/user/www/wordpress.test”
Remember to change “user” with your username.
And replace the line
ServerName dummy-host2.example.com
with
ServerName wordpress.test
The end result should be like:
to save press control + O
to exit press control + X
Now we need to change the limits to our servers.
Optional step
MAMP is using the latest php version You may want to use an older version for better compatibility.
MAMP allows you to choose between the 2 last installed versions. To be able to choose a more compatible version thank 7.4 (current MAMP version of this article) simply rename the 7.4.1 version to something else.
At terminal type:
mv /Applications/MAMP/bin/php/php7.4.1 /Applications/MAMP/bin/php/NOphp7.4.1
and do the same for php 7.3.9
mv /Applications/MAMP/bin/php/php7.3.9 /Applications/MAMP/bin/php/NOphp7.3.9
(The versions may change for your installation)
Then close MAMP completely
Open MAMP again and click Preferences.
At php tab choose 7.0.33 and click OK
To find where our php.ini at MAMP start page (http://localhost/MAMP), click the phpinfo text
at the new page find the Loaded Configuration File line. That is the php.ini file we need.
Go back, at terminal and type
nano /Applications/MAMP/bin/php/php7.0.33/conf/php.ini
Go down with your pagedown key to the “Resource Limits” section and change these
from
max_excecution_time = 30
to
max_excecution_time = 3600
max_input_time = 60
to
max_input_time = 3600
memory_limit = 128M
to
memory_limit = 1024M
Then at the “Data Handling” section change
post_max_size = 8M
to
post_max_size = 1024M
to save press control + O
to exit press control + X
Now we need to edit the mysql for MAMP.
At terminal type
nano /Applications/MAMP/conf/my.cnf
it will open an empty file. You just need to copy – paste these:
[mysqld]
query_cache_size = 128M
query_cache_type = 1
query_cache_limit = 1M
port = 3306
key_buffer_size = 64M
max_allowed_packet = 512M
table_definition_cache = 5000
tmp_table_size=256M
max_heap_table_size=256M
sort_buffer_size = 16M
net_buffer_length = 16M
read_buffer_size = 16M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 512M
log_error_verbosity=3
default-storage-engine=MYISAM
skip-ssl
skip-federated
server-id = 1
skip-slave-start
collation-server = utf8_unicode_ci
init-connect=’SET NAMES utf8′
character-set-server = utf8
[mysqldump]
quick
max_allowed_packet = 2048M
[mysql]
no-auto-rehash
default-character-set=utf8
[isamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer_size = 2M
write_buffer_size = 2M
[myisamchk]
key_buffer_size = 20M
sort_buffer_size_size = 20M
read_buffer_size = 2M
write_buffer_size = 2M
[mysqlhotcopy]
interactive-timeout
to save press control + O
to exit press control + X
Finally, for the changes we done to take place, open MAMP and stop – start the servers.
Installing WordPress to MAMP
To be able to migrate to WordPress your CMS on your Mac your will need to have a… WordPress installation.
Return to the main MAMP settings screen (localhost/MAMP) and click the phpMyAdmin text
Then click new
Enter wordpress and click Create
Go to your downloads folder, extract the WordPress file to a folder, open it and copy all the contents of the folder to www -> wordpress.test
Now open your browser and go to:
http://wordpress.test
Now you can setup your WordPress as usually:
The default information for WordPress is:
Database: wordpress
MySql Username: root
MySql Password: root
Click submit -> Next and enter the final information:
Please change the username and password as you want. DO NOT USE admin/admin as above!
Please also enter your real email address.
And click Install WordPress.
Importing the CMS database from another server to MAMP MySQL server
Since you will be working on a local MAMP server on the MAC to migrate to WordPress your CMS, you will need to import that database to your local MySql.
Copying your database from your CMS to your MAMP:
- Export your database in a .sql file
- Copy this file to Downloads folder if it is not already there.
- Return to the main MAMP localhost screen (localhost/MAMP) and click the “phpmyadmin” text create a database with collation utf8_unicode_ci:
- Click Launchpad and open terminal
- In the terminal enter:/Applications/MAMP/Library/bin/mysql -uroot -p mycmsdatabase < /Users/yourusername/Downloads/mycmsdatabase.sqlWhere “mycmsdatabase” is your cms database and “yourusername” your Mac username.
At the “Enter password” prompt enter your MySql password. In our case “root” without the quotes and press Enter.
It is natural not to see the typed password, so please do not worry.
Starting the actual migration to WordPress!
After all this preparation you are now ready to start the actual migration of your CMS to WordPress.
- Return to your WordPress site at the FG plugin page: Tools > Import > {choose your CMS to import from}.
- Do not tick Remove only new imported data or Remove all WordPress content.
- Do not tick Automatically remove all the WordPress content before each import.
- Enter your LIVE CMS URL (not your WordPress) for example https://www.myprestajoomlashop.com/
- Enter as database the database you created and copied earlier:
Database: mycmsdatabase
Username: root
Password: mysql
CMS (prestashop, joomla etc) Table Prefix: ps_ - At media do NOT check these options unless you had issues from a previous import:
*Import external media
*Import media with duplicate names
*Force media import. Keep unchecked except if you had previously some media download issues. - Since we are at localhost we may need more timeout for the media:
Timeout for each media: 60 seconds - Press import!
- You can find an example configuration at the fg-plugin page and an explanation of all the options if you press the Help button at the top right corner.
The migration process can take from a few minutes to several hours depending on the size of your data, the speed of your machine and the speed of your connection. Please be patient and let FG Plugin save you hundreds of hours.