1
stgeorge
Xoops does not migrate to another Server
  • 2009/8/8 13:47

  • stgeorge

  • Just popping in

  • Posts: 13

  • Since: 2009/7/21


The database has been uploaded.
The mainfile.php has been edited for the new Server.
See below:

if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {

define("XOOPS_MAINFILE_INCLUDED",1);



// XOOPS Physical Path

// Physical path to your main XOOPS directory WITHOUT trailing slash

// Example: define('XOOPS_ROOT_PATH', '/home/a41xxxxx/public_html/xoops');

define('XOOPS_ROOT_PATH', '/home/a41xxxxx/public_html/xoops');



// XOOPS Virtual Path (URL)

// Virtual path to your main XOOPS directory WITHOUT trailing slash

// Example: define('XOOPS_URL', 'http://www.fxxxxxxxxxxxxx.net/xoops');

define('XOOPS_URL', 'http://www.xxxxxxxxxxxxx.net/xoops');



define('XOOPS_CHECK_PATH', '1');

// Protect against external scripts execution if safe mode is not enabled

if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {

if ( function_exists('debug_backtrace') ) {

$xoopsScriptPath = debug_backtrace();

if ( !count($xoopsScriptPath) ) {

die("XOOPS path check: this file cannot be requested directly");

}

$xoopsScriptPath = $xoopsScriptPath[0]['file'];

} else {

$xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_FILENAME'];

}

if ( DIRECTORY_SEPARATOR != '/' ) {

// IIS6 may double the \ chars

$xoopsScriptPath = str_replace( strpos( $xoopsScriptPath, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsScriptPath);

}

if ( strcasecmp( substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) {

exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");

}

}



// Database

// Choose the database to be used

define('XOOPS_DB_TYPE', 'mysql');



// Table Prefix

// This prefix will be added to all new tables created to avoid name conflict in the database. Please change this to something different than 'xoops'.

define('XOOPS_DB_PREFIX', 'xxxxxx');



// Database Hostname

// Hostname of the database server. If you are unsure, 'localhost' works in most cases.

define('XOOPS_DB_HOST', 'xxxxxxxx');



// Database Username

// Your database user account on the host

define('XOOPS_DB_USER', 'a41xxxxx_xxxxxxx');



// Database Password

// Password for your database user account

define('XOOPS_DB_PASS', 'xxxxxxx');



// Database Name

// The name of database on the host. The installer will attempt to create the database if not exist

define('XOOPS_DB_NAME', 'a41xxxxx_xxxxxxx');



// Use persistent connection? (Yes=1 No=0)

// Default is 'No'. Choose 'No' if you are unsure.

define('XOOPS_DB_PCONNECT', "0");



define('XOOPS_GROUP_ADMIN', '1');

define('XOOPS_GROUP_USERS', '2');

define('XOOPS_GROUP_ANONYMOUS', '3');



if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {

require XOOPS_ROOT_PATH."/include/common.php";

}

}

?>

So can anyone tell me why I get this error:

XOOPS root path not defined

It is defined correctly as it works with:
Joomla
Drupal
phpNuke
Nucleus
Mambo
phpWebsite
postNuke
Wordpress
Zikula
ocPortal

Not necessarily exactly the same site or account but the same host.

I have tried migrating XOOPS to three other servers and always get the same error.

Edit by Ghia: anonimized SQL data

2
ghia
Re: Xoops does not migrate to another Server
  • 2009/8/8 14:07

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


When moving between servers, you have also to clear the cache folders (except index.html) and delete the records in table session.
Check also the database tables for records which include the full (old) domain name and adapt them. Check this also for theme and template files.

3
stgeorge
Re: Xoops does not migrate to another Server
  • 2009/8/9 8:18

  • stgeorge

  • Just popping in

  • Posts: 13

  • Since: 2009/7/21


Thanks for the reply.
I did clear the all caches after initial errors to no avail. I did not think that the database would fill up with references on a new installation relating to paths.
That is what a config file is for isn't it?
It would be easier in that case to make a new install, but that would mean of course that the old database is not importable without what seems to be too much editing prior to migration.
So my original statement appears correct.
Xoops does not migrate.
The reason I think this is an important issue is that with the proliferation of hosting services it is important to be able to move an installation immediately a host causes a problem.
Uptime is King.
The best thing to do of course is to have the website on two or more Servers and back up to the spare servers. I have all my sites on three servers.
If there is a problem I change the DNS and have limited downtime. My DNS is usually switched in under an hour.
This would not be possible with an XOOPS installation as the backups would be too time consuming.

4
sailjapan
Re: Xoops does not migrate to another Server

Quote:
So my original statement appears correct. XOOPS does not migrate.

Mine did, so that can't be right.

Has your server environment changed in any way? (php version etc...)?

5
stgeorge
Re: Xoops does not migrate to another Server
  • 2009/8/9 14:44

  • stgeorge

  • Just popping in

  • Posts: 13

  • Since: 2009/7/21


All Server environments are different.
But the requirements for XOOPS are met on all the Servers I have tried to migrate the installation too.
The Servers I am using have had all the above listed CMS's moved to and from no problems at all.
MySQL databases are all slightly different in some way and if there is a problem a query will normally arise.
I do this on a regular basis as I always use three hosts for my website domains and if there are problems I just change my DNS.
I have 17 domains and each of those sites has three servers or hosts and on each site maybe 2 or three CMS's.
I did put XOOPS onto dedicated domains with it's own database as sometimes scripts do not like to be either in a shared database or even on a domain with another script.
The reason I am trying XOOPS is to see if it migrates easily as my clients use the domain registrar I use as it can swich DNS in under 3 hours. I rarely wait longer than an hour.
The migration process is also important because rather than backing up to the computer we back up to the replicated sites. Thereby keeping 3 copies of a website on completely different Servers or Hosts.

6
mboyden
Re: Xoops does not migrate to another Server
  • 2009/8/9 15:27

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


One of the strengths of most any php-based application or CMS is its ability to be easily moved or updated. XOOPS can easily be migrated from one server to another -- as a new deployment or an upgrade to an existing installation. I do it all the time as I do development and testing (and production) in separate environments, sometimes on the same server, sometimes on a different server with the same setup, and sometimes in a different environment than production. The last version is the one that takes more work, but generally it can be done. In the latter setup, I also do a test deployment setup on the same server under a different domain to test the deployment process before deploying to the production server.

This is the server migration process that I generally use:

Migrating/Replace XOOPS to New Site
1. Export the database - use delete table (in case you have to reload the database more than once)
2. tar/gzip the entire site (include XOOPS_TRUSTED_PATH of course)
3. Create database/use for new site (if not already setup)
4. Search/Replace hard-coded local URLs in SQL script (make URLs relative!; search web/file paths)
- Domains: dev.mydomain.com
- Emails: @mydomain.com (most, but not all, so do one-by-one)
- Paths: /home/myaccount/public_html
- _MI_XI_REFERER (fix data as appropriate)
5. Import database to new site (convert latin1 to utf8 as appropriate)
6. Untar files in new site
7. Fix symlinks for cache/template directories
8. Fix mainfile.php with new database, XOOPS root path/url, trusted, etc.
9. Fix .htaccess with new domain/url (if used)

To make sure it's easily deployable to another server, ensure all URLs on your site relative

Now, if you are updating an existing site, that gets harder but is manageable done right. I posted a process for upgrading a 2.0.x site to 2.3.x (never worked with 2.2.x, so no help from me there).

Hope that helps.

7
stgeorge
Re: Xoops does not migrate to another Server
  • 2009/8/9 15:52

  • stgeorge

  • Just popping in

  • Posts: 13

  • Since: 2009/7/21


It's the best walk through I think I have seen to migrate a site.

Can I ask why XOOPS is not storing url's as relative to the database automatically.

I am still a little confused as to why the database would be storing information contained within the script.
For example if the absolute and root paths are defined within the script there is no need to add anything to the database. Sure menu items and external url's will enter a database, but the base configuration has no need to be anywhere but the config file, in this case mainfile.php.
There are rare times when there may be two config files.
Normally one in root and one in admin, if there is to be two, (often found in e-commerce cms).

I appreciate your guide and I followed the link, did not get that on a search, but like most searches one does need to know the right search term to get the answer.

I will look into the database and try again.

8
ghia
Re: Xoops does not migrate to another Server
  • 2009/8/9 19:45

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
Can I ask why XOOPS is not storing url's as relative to the database automatically.
In principle it does. However some modules, editors or users may not, so it is always good practise to examine the database when migrating to another domain. For server migration, without domain - URL change, only the physical directory paths in mainfile.php need to be adapted.

9
stgeorge
Re: Xoops does not migrate to another Server
  • 2009/8/17 6:40

  • stgeorge

  • Just popping in

  • Posts: 13

  • Since: 2009/7/21


Well this time no problems.

As tcnet pointed out in the a Post I made here:
https://xoops.org/modules/newbb/viewtopic.php?topic_id=68989&post_id=314137#forumpost314137

Initially I tried with an older version installed by Installatron.

Using the latest release I installed on one Server, configured and installed Modules and Themes, edited the theme I will be using to suit the site on the different server, followed the Steps on this page by mboyden.

I am not used to editing the sql file for migrations, (normally do any alterations to file paths etc when the CMS is migrated through admin backend, menu, global etc). However using notepad++ the Search mechanism made it simple to edit and replace any possible causes for error.

This was a fresh install I migrated with very little added data. Total time spent on migration including Server time for backups and dumping onto new Server, 45 minutes.

Easy when you find the right Guide.

Thanks to all who posted for the help and advice.

Xoops has a new convert, this is probably the simplest CMS I have used, that is why the migration issue was important to me.

10
stgeorge
Re: Xoops does not migrate to another Server
  • 2009/8/23 12:20

  • stgeorge

  • Just popping in

  • Posts: 13

  • Since: 2009/7/21


I posted too soon. Went into XOOPS today to finally to put the site live and realised that my URL's were a mess.
Spent another 4 hours looking for URL's.
Finally found them, I think.

Files that needed editing:
MYsql database.(4 instances)
root/mainfile.php
root/xoops_data/caches/xoops_cache/xoops_adminmenu_XoopsGuiDefault.php (150 instances)

/root/xoops_data/caches/smarty_cache/system-rational-default+.html (2 instances)

Note the path above is the path before you move your lib & data directories.

The above instances were on a new installation and migration.

Lets hope I have got everything!

Whilst configuring modules appears easy the migration process is a real mare.

Getting white Screened on Admin now as I got a warning that xoops_data & xoops_lib folders should be moved even though they are in a new directory and also have renamed the xoops_data & lib directories.

Because of this I moved them to another directory in domain root, whereas domain root/xoops installation directory (root)/folder for data & lib/xoops_data & xoops_lib was where they were before.

The installation was working as above, however when I tried to move the folders into domain root below the XOOPS installation directory and altered mainfile.php I got white screened and could not access admin.
The site was up though.

I cannot understand the warning when I have done the aforesaid renaming and creating a new directory.

So now the installation is a mess again.

Never had this much trouble configuring a CMS before so now revert back to being unconverted.

Login

Who's Online

213 user(s) are online (133 user(s) are browsing Support Forums)


Members: 0


Guests: 213


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits