There are several guides for server migration under ExpressionEngine 1.x, but so far nothing on migrating ExpressionEngine 2.1. This guide is based our our own experience of moving a site from a development environment to a production environment. We have tried to capture as many aspects of the move as possible, but every EE site is different. You may find that we include steps which you can omit, or you may discover that there are additional steps you need to take.
This tutorial assumes that your development environment is on a different server than your production environment. If this is not the case, you can still use much of this tutorial, but note that some steps may not apply, or may only partially apply.
It can’t be said enough - before you start making any significant changes to your database or file system, backup your data!
Creating a backup of your data is always a good idea before undertaking any major changes. Moving a site from a development environment to a production environment is considered a major change, so make sure you have a backup of your data in case something goes terribly wrong.
If you are not saving your templates as flat files (i.e., in the file system), skip to Step 3.
If you are saving your templates as flat files, make certain that your templates are all synchronized before beginning. If your templates are not synchronized, you might encounter some trouble in the production environment, particularly if the last changes you made to the templates were made to the flat files and not in the Template Manager.
To synchronize your templates, in the Control Panel, go to Design > Templates > Synchronize Templates.
If the Sync column has all green check marks, you’re good to go, otherwise, sync those templates that are out of sync until they are all checked green.
If you have access to phpMyAdmin in your development environment, login. If not, you will need to export your database using a different tool. Some hosts provide different methods of exporting your data through a hosting control panel, or you might need to use the command line if you are using a local development environment without phpMyAdmin. This step will detail how you go about using phpMyAdmin.
After logging in to phpMyAdmin, select the correct database from the left-hand column. Depending on your environment, you may have only one database listed. Once selected, you should see something like this:
Make a note of the Collation method listed. It will usually be utf8_general_ci, but if there is another collation used, like latin1, make a note of this. When we reimport the data, you will need to use the same collation, or things might break entirely.
Click on the Export tab. You will be presented with a number of options.
Verify that all of the tables are selected, that you have selected to export as SQL, that you are exporting the Structure of the database, and that you are exporting the data, itself. Verify that the “Save as File” box is ticked, name your export, and click Go. This will generate an SQL file that you must save somewhere. We will need this SQL file to import it into the production environment.
Now you need to create a new database on your production server. This is generally done through a Database Manager in the hosting control panel. When you create the database, you will either create a MySQL username and password at the same time, or you will assign an existing MySQL username and password to the new database. For security reasons it is a good idea to have a separate username and password for each production database. When creating the database, make a note of the following items, as you will need them later:
Now, login to phpMyAdmin on the production server. You should see your newly created database in the left-hand column, but it will have no tables assigned to it. Select the database and then select the “import” option on the screen that appears:
You will now be presented with the import options:
Select the SQL file that was created in Step 3. Verify that the same collation is being used. For most database imports, you should uncheck to box under Partial Import. If your SQL file is very large, it might exceed limits set on your server. In the example image above, the limit is 7,168 KiB. Your server may vary. If your SQL file is smaller than the size limit, you should always uncheck the Partial Import box. If your file is larger than the limit, you can allow partial imports. Partial imports are beyond the scope of this tutorial and will not be covered further.
Once set, click the “Go” button to upload and import your data. If successful, the left-hand column should populate with all of your tables.
First, if you are deploying an ExpressionEngine site to a production environment where a non-ExpressionEngine website currently exists, backup the data on the existing production server. Do not simply delete the existing file system or overwrite it. If something goes wrong, you will not be able to recover the old production system.
Now, make sure that the development file system is backed up. (You already did that in step 1, right?)
You have two options for migrating the development file system. The fastest is generally to archive the contents of the development server (zip or tar, for example) and upload the archive to the production server where you will extract the contents. However, if your hosting control panel does not give you access to create an archive (on the development server) or extract an archive (on the production server) this option may not be available.
If you can’t create an archive on the development server, but you can extract one on the production server, you can download the file system to your local machine and create the archive locally.
If you can’t extract the archive on the production server, you will need to upload the file system as folders and files, which will take longer.
Once you have all of the files in place on the production server, whether you used the archive method or the individual files method, you must verify permissions as follows. If you are using a Unix server (or Unix variant, like Linux, OS X, FreeBSD, etc.) you must set the following files to 666 (or equivalent write permissions on your server):
And the follow directories to 777 (or equivalent write permissions on your server):
If you are saving templates as flat files, you must set the relevant directory (and all its subdirectories) (usually located inside /system/expressionengine/templates/) to 755.
If you have any other special directories or files that require permissions, set those now. For example, several add-ons that manipulate files, such as ED Image Resizer, require that the directory for sized images be set to 777.
Now, grab those notes about the database, and use them to update the contents of /system/expressionengine/config/database.php.
Next, open /system/expressionengine/config/config.php and set the correct URLS for the following variables:
If all has gone well so far, you should be able to login to your control panel at http://yourdomain.tld/system/. If the server balks, try http://yourdomain.tld/system/index.php. If you still can’t get the Control Panel, something has gone wrong. I hope you backed everything up.
Once you have logged into the CP, there are several places where you need to change paths. If you don’t know your new server path, there are several ways to find this. The easiest is to look for the _SERVER[“DOMAIN_PATH”] variable in Tools > Utilities > PHP Info:
Once you have your path information, update it in the CP. Here are the most common area you’ll need to update:
If you used any server paths or absolute URLs pointing to your development environment anywhere else, you need to update those now. Common things to look out for:
If you aren’t saving templates as files, skip to Step 10.
If you are saving templates as files, verify that you can properly sync your templates using the Synchronize Templates feature. If you can’t, you may need to delete the directory specified in Design > Template Manager > Global Template Preferences from the file system and recreate that directory again on the production server. This is only true on servers that have ownership issues with the your specified template directory.
Clear all Caches in Tools > Data > Clear Caching
This is to verify that there is no residual cache data from the development server.
If all went well, you should be able to navigate to http://yourdomain.tld/ and everything will work.
Plagued by Fatal error: Class 'EllisLab \ ExpressionEngine \ Service \ Database \ Database' not found? I was too. And it was my own fault.
ExpressionEngine is a well known content management system (CMS). Many large organizations around the world use this system to run their websites. The reason is simple- ExpressionEngine is highly customizable and stable which is why it is preferred by so many web developers. One of the greatest benefits of using ExpressionEngine to manage content on your website is that it is easy to use. You don't have to know PHP (the programming language it is written in) to use ExpressionEngine. The makers have kept the user interface user friendly and simple without sacrificing the system's utility.
ExpressionEngine is one of the advanced web design and development tools that you can use today. With ExpressionEngine, creating highly sophisticated websites with intricate details is possible. So now you have a highly complex yet user-friendly ExpressionEngine e-commerce site for your business. But how safe is it for monetary transactions? Will your customers' financial information and demographic information be safe on your site? Security is one of the most important things you should consider when designing an ExpressionEngine e-commerce site for a business. In this article, we will focus on what you should do to secure your ExpressionEngine website. The idea is to make sure that your website is secure and also efficient.