HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

ocPortal Tutorial: Moving servers (including copying themes manually)

Written by Chris Graham, ocProducts

Important note

When moving servers, do not install ocPortal on the new one – transference is done at the file and database level, not by importing ocPortal data into a new installation.

The ocPortal quick installer handles all the work to installing ocPortal on a server automatically. However, if you choose to move to another server, some of this work will need to be re-done. This tutorial will explain the issues involved.

This tutorial is also partially relevant to those wishing to manually copy themes between installations. However for this case, all that applies is re-setting the file permissions underneath the copied themes directory. Alternatively, you can copy themes using the ocPortal addon system (export them and import them as addons).

If you are moving URLs, then you need to use the base configuration editor (the config_editor.php script) to change your base URL setting, and then to clear your caches using either the upgrader.php script or the Cleanup Tools in the Admin Zone.

If you are moving URLs but not servers, there is no need to perform any of the steps below: simply move the files to the new domain webroot directly, and update the base URL as described above.


ocPortal has an enormous number of files. The quick installer extracts all of these to the server so that you do not need to be concerned with transferring them individually.

The good news is that you can simply take a backup of your hosting space using a control panel backup feature, or doing it by hand if you have the access. Once you have your backup, you just need to extract it onto your new server. Exact details on how to do this are beyond the scope of this tutorial, as it depends on your control panel(s) and technique.

File permissions

Once files are transferred, you need to replicate the correct file permissions so that ocPortal can continue to function. File permissions are rarely transferred when actual files are transferred, due to the relationship between permissions and ownership credentials and the differences between ownership credentials on different servers.

You can get ocPortal to set the permissions for you, using a special feature you'll find in the http://mysite/upgrader.php script.

Manually setting permissions

If you have 'shell access' on your new server, typing the following from a shell inside your ocPortal installation directory will quickly fix your permissions to what they should be:


chmod +x

If you do not have such access, you will need to set permissions as specified for a manual installation in the 'Advanced Installation' tutorial. You will also need to give write access to anything you see that matches the following:

*/pages/comcode_custom/*/*.txt (So new/edited Comcode pages may be edited again)
themes/*/templates_custom/*.tpl (So new/overridden templates may be edited again)
themes/*/css_custom/*.css (So new/overridden css may be edited again)
uploads/*/* (So uploads may be deleted when content is)
lang_custom/*/*.ini (So language changes may be edited again)

You also need to delete:
themes/*/templates_cached/*/*.tcd / themes/*/templates_cached/*/*.tcp (So template cacheing can continue to function)
lang_cached/*/*.lcd (So language cacheing can continue to function)
(we could delete these files by clearing the cache, but the cache can only be cleared if they have write permissions to these files which you would need to set manually – so you might as well just delete the files manually anyway)

Lastly, you should clear the block cache from Admin Zone > Tools > Cleanup Tools.

Database contents

It is crucial that database contents is backed up and transferred to the new server, as this is where most data is stored. If the database settings are different, you will need to use the config_editor.php script to update your ocPortal settings (or edit info.php by hand).
You may need to update the following settings:
db_site, db_site_host, db_site_user, db_site_password, db_forums, db_forums_host, db_forums_user, db_forums_password

If you don't have shell access to import a database you'll probably end up trying to use whatever the web hosting control panel provides, which is usually phpMyAdmin. However you will struggle to import large databases with this. You may therefore find this tool useful: BigDump: Staggered MySQL Dump Importer.

See also