How to copy (or move) a working ExpressionEngine installation
First: Caveats!
Having done this dozens of times, it usually works without a problem. However, if you are making use of detailed .htaccess settings, they may not transfer smoothly from one server to another. Keep this in mind if you’re moving an unfamilar ExpressionEngine installation.
Step 1: Export your database
You don’t have to shut down your web site to do this, but you will need to insure that no one is working in the Expression Engine control panel while you are doing your export. If someone were in the middle of publishing an entry, that would not likely cause a problem, but you don’t want anyone changing extension settings while you do your database export.
There are three ways to export your database. Whichever you choose, you need to export as SQL. You may use:
- phpMyAdmin. This database administration tool is usually installed on servers that run Expression Engine.
- A desktop GUI like Heidi SQL.
- The command line, if you’re Linux-saavy.
Before exporting your database, go to your Expression Engine control panel: Admin—> Utilities—> Clear Cached Data, and clear all your caches. Now you can export your database to a ZIP or tar.gz file, and save to your desktop. Make sure you do not select a Create Database option in phpMyAdmin or other tool. Once this is complete, users may continue doing whatever they like in your Expression Engine control panel.
Step 2: Download all your site files via FTP
Download the files of your existing site via FTP. Depending on what elements you’ve added to your site, you may need to copy a lot of files, but these are the minimum:
- system folder (you may have renamed this)
- images folder
- themes folder
- path.php
- index.php
If you favor convention over configuration, you may want to copy folders like graphics, scripts and style as well, and use these conventions for your new site.
Step 3: Set up a database for your new site
Using one of the database administration tools noted above, create a database for your new site. Sometimes your hosting company will do this for you. Choose a database name that makes sense for your project. If you set username and password, use a strong, hard-to-guess password that is not a plain English word. Try something like 99choco11ate, or buzz000ing1bear.
Step 4: Import your database
Now you’ll need to import your previously exported database. Do this using the same database administration tool you used before.
Step 4: Rename and edit select files
- You may want to rename your system folder to something like client-admin. If you want to make it harder for nosy people to find, try something like admin388, where, perhaps, 388 is your client’s street number. This isn’t high security, but every little bit helps.
- Edit path.php to reflect the new path to your system folder. If you named your system folder admin388, then you would change this line: $system_path = “./admin388/”; to reflect its location.
- Edit system/config.php to reflect the new database name, username, password, and hostname of the database you created earlier. Go through each line and double-check your changes. Any error here will certainly mess up your project.
Step 5: Upload files and set their permissions
This may take a while, so get a coffee while you’re waiting. Note: Moving large numbers of files over regular FTP can sometimes cause FTP to crash. sFTP (also knows as FTP over SSH) is far more reliable.
Once this is done, you may need to set CHMOD on certain folders. CHMOD is a command that sets the read, write and execute permissions for files and folders. You don’t need to know know its inner workings, just how to apply it. You can do this from your FTP program, or use the Linux command line. In CuteFTP Pro, for example, right clicking on files or folders gives you the CHMOD option.
Set the following files to CHMOD 666:
- path.php
- system/config.php
- system/config_bak.php
Set the following directories to CHMOD 777:
- images/avatars/uploads/
- images/captchas/
- images/member_photos/
- images/pm_attachments/
- images/signature_attachments/
- images/uploads/
- system/cache/ *Make sure the subfolders in system/cache are empty, if not, delete their contents, leaving the subfolders.
Step 6: Configure your new Expression Engine installation
If you followed all the steps correctly, you should be able to go to domainname.com/system and login. Since you copied an existing database, your username and password will be the same as you used on the site from which you copied the database and files. Note: when you login, the Expression Engine control panel will look like a giant mess. Don’t worry—this is because Expression Engine cannot yet find the stylesheet for the control panel.
Now there are some settings to update. Note: You can allso change all these settings at once by using Deploy Helper, which I recommend.
- Go to Admin—> System Preferences—> General Configuration. Enter the correct information for each line.
- If you do not know the URL to your themes folder, go to Admin—> Utilities—> PHP Info. Scroll down until you see _SERVER[“SCRIPT_FILENAME”]. This will give you a clue to the path you need to fill in. It will typically be something like /www/your_account_name/public_html/themes/
- Go through your weblogs, category groups, member groups, members and galleries, deleting what you don’t need. You don’t have to do this right away, but each project is different, so you probably won’t need exactly the same content structure.
- Update your CAPTCHA settings at Admin—> System Prerefences—> Captcha Preferences. You’ll need a similar path to what you used for the themes folder, i.e., /www/your_account_name/public_html/images/captchas
Step 7: Configure extension and module settings
Go through your extensions and modules one by one, making sure any setting that use system or URL paths are correct for your web site.
Step 8: Rejoice, you’re done!
Ok, well, you’re not really done. You still have to built a web site in Expression Engine now that you’ve installed it. However, you’ve given yourself a head start. All the configurations that worked so well in your original Expression Engine installation will work the same in your new installation.





