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 moving the files directly on the server will suffice.
Table of contents
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.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:
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:
You also need to delete:
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)
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 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)lang_cached/*/*.lcd (So language cacheing can continue to function)



