Tip #17: Moving OpenX
A question that is often asked about the OpenX ad server is how to move the installation. Generally, this means one of two things — either how to move the installation from one server to another, or how to change the domain name that OpenX is installed on.
Moving server
Moving an OpenX ad server installation from one server to another is a relatively straightforward task, provided you don’t want to get too fussy and technical about it. The following approach for moving an OpenX installation to a new server is a simple, quick and easy way to get an installation moved.
- Ensure that your new server is set up with MySQL, a web server, PHP, etc. and is configured and working1.
- Backup your OpenX database on the old server.
- Restore the database on the new server2.
- Backup the entire OpenX ad server directory on the old server.
- Restore the entire OpenX ad server directory on the new server. Double check that the read/write permissions of the files have not been altered3.
- If required, backup the entire OpenX banner directory on the old server.
- If required, restore the entire OpenX banner directory on the new server. Double check that the read/write permissions of the files have not been altered4.
- Test logging into and using OpenX, on the new server.
- Test banner delivery on the new server.
- Change to use the new server in production!
Unfortunately, this approach does have a down side, in that once the OpenX database has been backed up in the second step, any changes to the database, including all data recorded by OpenX for banner delivery on the old server while the migration is “in progress”, will be lost.
Moving domain
Moving an OpenX ad server installation from one domain to another is very straight forward.
- Change your web server software to the new domain.
- Re-name your OpenX configuration file. For example, if your OpenX installation used to be on “www.example.com” and you are moving it to “www.newsite.com”, you would have a configuration file in the OpenX “var” folder called “www.example.com.conf.php”, which needs to be re-named to “www.newsite.com.conf.php”.
- Edit the re-named configuration file. In the [webpath] section, update the admin, delivery, deliverySSL, images and imagesSSL sections to use the new domain.
- Edit any other configuration files, including the “default.conf.php” file. These files may contain a “realConfig” item, which is a reference to the “master” configuration file. Update to the new domain name as required.
Moving server and domain at the same time
The Guru does not recommend that you do this. If you need to move server and you need to move domain name, do one first, and then do the other. Give yourself a day or two between each of the two steps, to really make sure that everything is working fine after the first step, otherwise if you end up with a problem, it won’t be possible to determine which change might be responsible!
- You may want to perform a clean test installation of OpenX on the server to ensure that everything is working before proceeding with the move. [↩]
- Don’t forget that you also need to ensure that all of your database users and permissions are set up on the new server as well! [↩]
- You may also need to address file ownership, in the event that your new server’s web server configuration is different to the old server. [↩]
- Again, check file ownership. [↩]
Thank you for this post. This helped us troubleshoot a problem we were having.
Don’t forget to change the information at “webDir=” in the [store] section. Other than that, Thank you for the excellent write-up!
Hi Mikey,
You don’t need to change the webDir setting if you are moving a server — so long as you keep the same directory structure on the new server! Of course, if you are changing directory structure at the same time, then yes, this setting may need to be changed, depending on your OpenX configuration…
I moved the install as described and it is serving banners as expected. When I try to administer it I get the following error. The first lines represent the new and correct path of the current (new) host. The last line is the path used in the old host. I can’t find a config file to change that, I assumed all paths were based on the MAX_PATH variable.
/home3/organij9/public_html/torchlightdirectory/openx/var => OK
/home3/organij9/public_html/torchlightdirectory/openx/var/cache => OK
/home3/organij9/public_html/torchlightdirectory/openx/var/plugins => OK
/home3/organij9/public_html/torchlightdirectory/openx/var/plugins/cache => OK
/home3/organij9/public_html/torchlightdirectory/openx/var/plugins/config => OK
/home3/organij9/public_html/torchlightdirectory/openx/var/templates_compiled => OK
/home/torchlig/public_html/openx/www/images => NOT writeable
^^^^^^^^^^^^
this path is the old host directory structure
Never mind, I found the variable “webDir” in openx/var/domain.com.conf.php and changed it appropriately.
If you are reading the above comments, and you’re wondering about the “webDir” setting, and why it is not based on the MAX_PATH settings, please have a look at Tip #5!