Nothing in cyberspace is sacred
So, I wanted to backup my web site to my MAMP on my iMac. But not just put it on my iMac – I wanted it to work, and to do so in a MAMP subdirectory. If you have a Windows machine (yes, there is also a MAMP for Windows now), you can extrapolate after following the bouncing ball below, as it were.
You have two friends that will help you along in your journey: CPanel file manager and PhpMyAdmin. My thanks to Google searches to help me finish off my project. NOTE: You must have access to CPanel to do this first part. If you don’t have it, tell your provider what you would like to do, and they likely do it for you, or tell you their process.
The basics: You need to compress your ENTIRE website in CPanel using File Manager, then download the zipped file. Please note that you aren’t harming your working site by doing this. CPanel actually copies your site before compressing that copy into a zip archive. Remember to delete that zipped file after you’ve downloaded it.
Then you need to download your site’s MySQL database in CPanel either by 1) exporting your database using CPanel’s PhpMyAdmin’s “export” function, or 2) choosing “Backups” on the front page of CPanel. I chose “Backups,” which lets me choose the site’s database name and then download it by clicking on the database’s name.
OK, that’s the skeleton. Now we need to move the compressed site and its MySQL database into MAMP.
Let’s do the database first. Open up MAMP’s PhpMyAdmin and create a new database. Give it the SAME NAME as the one you downloaded. Now using PhpMyAdmin, use the IMPORT function to import your database. Save the file and close it. Now, click on the “Home” button in PhpMyAdmin (the little ‘house’), and then click on “Databases,” and you’ll see the list list of databases you have. Now, find your database’s name and click on the check box next to it. DON’T open it, just click on the checkbox. Now click on “Users”, which will show the list of users. You’ll want to “Add User”. Enter in your MySQL user name and password you used on your original website. You’ll see that the box is also checked that adds your user to the database you checked – including all privileges for that database. Now click on “Go” and you’re done.
You’re finished with PhpMyAdmin. But wait – was your database too large to import into PhpMyadmin? We’ve got an app for that – PhpMyAdmin itself.
Navigate to your PhpMyAdmin folder. On the Mac, it’s in /Applications/MAMP/bin/PhpMyAdmin. In that directory, find the file named “config.inc.php“. Open it up in a text editor (not in a word processing program such as Microsoft Word, which adds coding junk to any text it touches).
Find the line:
cfg[‘UploadDir’] = ”;
Change it to:
cfg[‘UploadDir’] = ‘upload’;
Now go into the PhpMyAdmin directory and create a folder called “upload” (without the quotes).
This folder is where you’ll put your MySQL database you downloaded in CPanel so it can be imported into MAMP’s PhpMyAdmin. After you edit the “config.inc.php” file, create the “upload” folder and put your large MySQL file in it – open PhpMyAdmin, and click on “Import”. You’ll notice a new import selection – yep, it’s the “upload” folder you just created. And yep, that MySQL file you put in it is also there. Click on the radio button next to the folder, select the file in it, click “Go” and it will import.
NOTE: This trick also works for XAMPP and large MySQL database files. So now you know.
OK, you’re done with PhpMyAdmin.
In the next post, we’ll deal with the zip file you created of your website and the configuration of your WordPress site to run in a MAMP subdirectory.
You must be logged in to post a comment.