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

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.



Files

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.

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:

Code

chmod +x fixperms.sh
./fixperms.sh



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 (So template caching can continue to function)
lang_cached/*/*.lcd (So language caching can continue to function)

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).


See also