SmartFAQ is developed by The SmartFactory (, a division of InBox Solutions (

How do I move my site from one server to another?
Moving your site exactly as it is from one server to another is a quite simple task.

a) Upload exactly the same files as on the first server to the second server
b) Export the database from the first server to the second server, using a tool like PHPMyAdmin
c) Modify mainfile.php on the second server to have the correct physical path, URL and database connection details
d) On the second server, set cache, templates_c and uploads directories to be writeable by the server and set mainfile.php to be read-only

See also this FAQ here

For more detailed account of site migration, see below.

--- Additional details submitted by Jdseymour on 2005/1/20 22:21:02

The first thing that you want to do, and should even do this when not migrating, is download an updated exact copy of your website with full directory structure intact. You can easily do this with your favorite FTP program.

I also, in cPanel (my preferred control panel) do a full site backup, database backup, and a home directory backup. This can be accomplished in cPanels backup utility. The home directory and the database backup will download to disk automatically in gzip format. The full site backup will be created and is found in your website's home directory. Use an FTP program to download it.

Why the three types of backups? Redundancy, if something goes wrong I can restore the full site or part of it easily in the cPanel backup utility restore function.

So we now have our website copied to disk, and our backups. We now need to upload all website files to the new servers root directory, with exact directory structure intact. Once this is done check all your folder permissions and adjust as required. For certain the uploads, template_c and the cache folders should be chmod 777, but also other folders required by modules also need to be adjusted to writable.

Next we need to work on the database.

No cammand line interface to the site. That left me with one option, PHPmyadmin.

The only problem with restoriing, or installing a database with PHPmyadmin is the script timeout error. PHPmyadmin can load small databases with no trouble, but if you have a larger database, more than 2.5 to 3MB the operation will time out. My database is a little over 7MB so there was no way for me to install the full database with PHPmyadmin.

OK. So I have 144 tables with 7 mb of information. How would I get this database installed?

The solution was to break the database up into smaller chunks and install it a piece at a time.

I logged in to PHPmyadmin on my former site and exported sections of the database keeping whole module sections intact. In all I divided the database up into seven 1MB chunks. Had seven folders on my local computer named , restore1, restore2 and so on.

When you export from PHPmyadmin check the following options in the export options: SQL, Add DROP TABLE, Add AUTO_INCREMENT, Enclose table and field names with backquotes, Use hexadecimal for binary fields, set the export type to INSERT, set the filename template to _DB_, and tick to export in "gzipped" format. Select the tables that you want to export (hold down the CTRL key while clicking multiple tables for export.)

Next I logged in to PHPmyadmin on the new site and installed each table chunk to the database. To do this click on the SQL tab, click on browse, a file browse window appears, locate and select the file then click the go button. The file will be uploaded then installed to the database. Once completed PHPmyadmin will give you a success or failure screen with the number of operations performed.

Once all of the tables are installed click on the Structure tab, scroll to the bottom, click on check all (which just puts a check mark by all tables). There is a dropdown list titled With Selected, click on that and select Analyze Table.

Click the Structure tab again and click on Check All. Go back to the dropdown list and select Repair Table. All tables should be listed with an "OK" by them.

So now we have the website and the database installed. Now we need to configure mainfile.php.

The permissions settings for mainfile.php should be OK by default for what we want to do now. Get out your favorite text editor open the copy of minfile.php in your site copy on your local computer. Check the entries for :


// XOOPS Physical Path
// Physical path to your main XOOPS directory WITHOUT trailing slash
define('XOOPS_ROOT_PATH', 'var/www/html/');

// XOOPS Virtual Path (URL)
// Virtual path to your main XOOPS directory WITHOUT trailing slash
define('XOOPS_URL', '');

And make any necessary changes. then check all your database information entered in the file, and make any necessary changes.

Copy mainfile.php to your new server replacing the original. Use the cPanel File Manager utility and chmod mainfile.php to 0444. This make this file read only.

Now the only thing left to change is the DNS setting of your domain name. You should have been provided with a primary and secondary DNS server hostname or IP address by the hosting provider. Go to your domain name providers control panel and change the pointers to these provided servers.

It will take some time, usually several hours to one day for the new DNS settings to propagate throughout the internet. At that time your domain will go to the new site location instead of the old one. The old site can be taken offline anytime after the change is made.

The comments are owned by the author. We aren't responsible for their content.

 Parse Error!!

mmm... i've done what he says... but i always get this message:

Parse error: parse error, unexpected T_STRING in /home/b2l1439/public_html/xoops/mainfile.php on line 77

in the line 77 is a password. should i change the password?


 Re: Parse Error!!

You should write it with correct syntax, i.e.



 Re: Parse Error!!

mmm...the first problem was finish. Now i get this message:

This page cannot be displayed due to an internal error.

you are the administrator of this siteplease visit the XOOPS Troubleshooting Page for assistance.

Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34

i've 444 the mainfile.php. and i think i've put the right database name and password.. :(


 Re: Break down database?

I'm trying to move sites at the moment, utter pain in the butt with timeouts whilst uploading etc. Database is a headache. How do you section it into smaller chunks? could do it a few tables at a time but one table is pretty big.

EDIT: Just found Bigdump


 Re: Parse Error!!

my previous database prefix is xoops_groups etc. but after i remove to another server, it's automatically change to b2l1439_xoops.xoops_groups. My question, what is my new database prefix now? is it b2l1439_xoops.xoops? or b2l1439_xoops.xoops_? :( im really confuse with this...


 Re: Parse Error!!



That is not the database prefix (and a note of caution - do not disclose database and prefix names to anyone)

in this case the b2etc. is the DATABASE name, your prefix is still xoops


 Re: Parse Error!!

okey, my web site works fine now. i think everybody should check and rechek the username and password of their database... :( and don't forget to 444 the mainfile.php... ;)

THanks for your help Mithrandir.. ;)


 Update absolute URLs in the DB

If you need to update absolute / incorrect URLs, try this handy MySQL function:

update [table_nameset [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

I ran it from PHPMyAdmin as SQL against a couple of tables and it worked like a charm


 Importing SQL files

I can highly recommend BigDump. Even though my SQL file was well within PHPMyAdmin's timeout I still had 'memory exhausted' errors from my host when I tried to import it directly from my PC.

It took just a couple of minutes to configure the BigDump script, about the same to upload it along with my SQL file and about 3 seconds to populate the database. Very straightforward.


 Re: Importing SQL files

I'm trying to be diligent about making site backups as well in case something goes wrong or I have to move to a new host: I make backups of the XOOPS SQL DB, full site backup and home dir backup all through the cPanel backup utility (to avoid timeout problems with big DBs in PhpMyAdmin)

My question is, if I have to upload my site to a new host, which backup should I be uploading? The home dir backup or the full one?

From the article it seems like if you have the home dir backup and the SQL db backup that's all you need, is there an advantage to using the full backup option? What does it give you that the home dir+DB doesn't?

Sorry for this, but I'm new to site development and I want to make sure I'll know what to do if something goes wrong


 Re: Importing SQL files

The home dir backup backs up the actual files that go into the root directory, all content however is in the database. You may be able to use cPanels fullsite backup to install into a new cPanel enabled host, but I was not able to do that. I generally backup my site (home dir) when I change anything physical (such as add a new module, or changes to the theme). The important backups is your content (the database), I backup my database every day, and keep several copys (usually a weeks worth) in case it is a day or two before I discover a problem.

I currently have added two articles on my site about this, you can view them:

Regular Database Backup with Cron(Updated)


MySQL Database Restore

I hope these give you some ideas.


 Re: Importing SQL files

Full backups on cpanel will include the home directory ANd everything else on your webspace, ie mail, logs, and non public files and folders.

HomeDir backups limit the files to ONLy those in public_html folder, ie your root public webspace.

If you only want trhe website files a full backup should not be required. However, I would always check your downloaded files by decompressing the backup and making sure everything is there correctly.


 Re: Importing SQL files

Thanks , makes much more sense now.


 Re: Importing SQL files

I got this error trying to dump my database so my website looks like this:\r\n\r\n\r\n \r\nany help?\r\n\r\n\r\nCREATE TABLE `pixelsol_nas_atikel` (\r\n\r\n`storyid` int( 8 ) unsigned NOT NULL AUTO_INCREMENT ,\r\n`uid` int( 5 ) unsigned NOT NULL default ''0'',\r\n`title` varchar( 255 ) COLLATE latin1_general_ci NOT NULL default '''',\r\n`created` int( 10 ) unsigned NOT NULL default ''0'',\r\n`published` int( 10 ) unsigned NOT NULL default ''0'',\r\n`expired` int( 10 ) unsigned NOT NULL default ''0'',\r\n`hostname` varchar( 20 ) COLLATE latin1_general_ci NOT NULL default '''',\r\n`nohtml` tinyint( 1 ) NOT NULL default ''0'',\r\n`nosmiley` tinyint( 1 ) NOT NULL default ''0'',\r\n`hometext` text COLLATE latin1_general_ci NOT NULL ,\r\n`bodytext` text COLLATE latin1_general_ci NOT NULL ,\r\n`counter` int( 8 ) unsigned NOT NULL default ''0'',\r\n`topicid` smallint( 4 ) unsigned NOT NULL default ''1'',\r\n`ihome` tinyint( 1 ) NOT NULL default ''0'',\r\n`notifypub` tinyint( 1 ) NOT NULL default ''0'',\r\n`story_type` varchar( 5 ) COLLATE latin1_general_ci NOT NULL default '''',\r\n`topicdisplay` tinyint( 1 ) NOT NULL default ''0'',\r\n`topicalign` char( 1 ) COLLATE latin1_general_ci NOT NULL default ''R'',\r\n`comments` smallint( 5 ) unsigned NOT NULL default ''0'',\r\nPRIMARY KEY ( `storyid` ) ,\r\nKEY `idxstoriestopic` ( `topicid` ) ,\r\nKEY `ihome` ( `ihome` ) ,\r\nKEY `uid` ( `uid` ) ,\r\nKEY `published_ihome` ( `published` , `ihome` ) ,\r\nKEY `title` ( `title` ( 40 ) ) ,\r\nKEY `created` ( `created` ) ,\r\nFULLTEXT KEY `search` ( `title` , `hometext` , `bodytext` ) \r\n) ENGINE = MYISAM DEFAULT CHARSET = latin1 COLLATE = latin1_general_ci AUTO_INCREMENT =4 \r\nMySQL said: \r\n\r\n#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''collate latin1_general_ci NOT NULL default '''',\r\n `created` int


 importing SQL database. Help!

I'm in the process of moving my XOOPS site to another host. I'm having trouble moving my SQL database. I've gotten to the point of dumping my database from the old site but I can't import it into my new site.

What steps do I need to take? I tried creating a new database in mySQL, then using phpmyadmin...but when I try to upload the gzipped database I get the following error: #1044-Access denied for user "xxxxxx"@"localhost" to database "xxxxxx_xxxxxx".
What do I need to do to fix this issue?

Thanks for the help!!!


 Re: importing SQL database. Help!

You need to make sure that the user that you use in XOOPS to connect to the database has all database privileges.



I've moved my site, but now all the blocks do not show up, and the default templates instead of my modified ones are being used. ~_?


 Re: Problems

probably a dumb question but i exported the sql db but can not reinstall.

I wasing getting the database link error but now that the link is established just get a blank page. I guess because the new database is empty. How do I install the data? I can't seem to get to phpmyadmin although i know the module is there and it kicks me out for not having access rights...

any ideas?



does anyone know in which character set phpmyadmin exports the sql database in?

also can an an sql database exported in phpmyadmin be imported on a new sever using mysql administrator software?


 Re: phpmyadmin

it'll export in whatever character set the db is in..

yes it can be try using phpmyadmin.. most server cpanels have it..

for more info, try the website, or phpmyadmin website, or the sql administrator website as they have all the info related in how to use their software.


 each modules display a blank content

I move my site web from a server to another.
I set the write right on template_c, upload, cache and module/xcgal/albums.
I restore the database.
I change the mainfile.php.

When I set the debug on, but there is not error. but some notice: about reference variable.
Like this: Notice [PHP]: Only variable references should be returned by reference in ....

I update modules via admin page. no change.
I remove all files in cache and template_c. no change.

I can see the home page and admin page, but all module display a blank content on center.

Exemple: I can see the random pictures in block but I can't see the galleries.

When I set template Smarty debug, I have {$SCRIPT_NAME} /modules/xcgal/index.php
for a {$xoops_rootpath} /usr/home/goubs/public_html/passionbon...
it's normal ?

go on to see what I say.

Php version : 4
xoops version :
Do you have any idea ?
by advance thank


 Re: each modules display a blank content

Try clearing your templates_c and cache folders. If you transfer these files from your old install, they may still have links referring to the old paths. If anymore problems please post in the forums.


 Creating a development area

Hi all,

Xoops newbie here; my first post.

I've been working on a non-profit site and others in the group suggested that we have a "development area" or "test area" to try out new themes, modules, templates, etc, but in a way that doesn't touch our main public site, but also having essentially our current public site content and being available by others in the group for review.

I searched around a tiny bit and couldn't find anything discussing how to create a development or testing area on the same hosted server as the live site. So, using the tips in this thread, I did the following. I hope it helps someone.

Is there anything wrong with what I've done? Any security issues?

I actually created two new areas, one that will become our new site someday, and a second that is a playground for the other webmasters to try out new things. They look like this:

--current main site is at http:///xoops/
--new dev site is at http:///xoops2/
--new playground is at http:///playground/

(I guess the steps in this thread could be combined and tweaked a bit to create a hot live backup in case the main site can't be used for some reason.)

Thanks for a great tool, Xoops!


We're hosted on surpass with fantastico. I'm writing this from memory, but it should work. Corrections welcome! Thanks.

--in cpanel fantastico, install a new installation of XOOPS in new directory "newdir" at the same level as the current main XOOPS site,

--in cpanel file manager, delete the new newdir XOOPS directory (yes, delete the one you just created, because it has the default content),

--in cpanel file manager, copy the current main XOOPS directory to yet a new newdir directory, because it has the main site content

--in cpanel file manager, edit public_html/newdir/mainfile.php, save it as mainfile-orig.php, edit it again to point to newdir in 2 places and to set db user to the same user as the main db in one place, don't touch the password, save it as mainfile.php this time.

--in cpanel mysql, delete the newly created user in the newly created database, and replace it with the same user of the main database. No need to touch the password.

--in cpanel mysql, phpmyadmin, in the current main site database, export tab, export the XOOPS database,

--in cpanel mysql, phpmyadmin, in the new database created by the XOOPS fantastico install process, structure tab, select all tables, drop all tables (they get recreated in the next step)

--in cpanel mysql, phpmyadmin, new database, sql tab, import the exported database


 Blank page after moving from server

After moving my website from a windows server to a freebsd I only get a blank screen.

This is the url, witch you can see is totally blank.

In directadmin I created a db, added the tables with phpmyadmin and changed the mainfile.php. Does anybody have an idea what I did wrong?


 Re: Blank page after moving from server

Empty the templates_c and cache folders.


 Re: Blank page after moving from server

I have cleaned the template_c and cache folder, but still I get an empty page.

I have moved my site from Macosx local to a hosting server.

At first I had a blank page, but reading the forums, indeed it was related to a space character in my "mainfile.php"


 Re: Blank page after moving from server

Same problem for me, while backup my sql files I did not set PHP debug on , and now it unable to solve what the problem is. Does anyone know how to enable "debug" function on. it will solve my problem , I think... is there a way to eneble debug at phpmyadmin or in sql file codes. Thanks


 Re: Blank page after moving from server

The FAQ on Blank Pages has instructions on how to enable PHP-Debug through phpmyadmin.



 Re: Blank page after moving from server

very very thanks you msdana I solved my problem... php debug worked ...


 Re: Blank page after moving from server

After moving my site from the old server to the new, I find myself locked out.

My username/password are not being recognized, I'm being sent to the user.php page

I entered the database and yes, my data is there.

I tried the Lost password function, but get no mail


 Re: Blank page after moving from server

I tried setting up the php debug on the old server, but now I get a blank page on admin.php

Now neither the old nor the new inbstallation works


 Re: Blank page after moving from server

make sure GZIP is disabled in preferences. as it doesn't function correctly.

if you can't get to admin, look in xoops_config table and find the entry for GZIP and disable it manually there (use phpmyadmin)


 Strange error after moving to new server

I've moved my XOOPS site to a new server, gotten the database to move and be recognized, and edited the mainfile.php . . . but I now get this error:

Fatal error: Call to a member function on a non-object in /path/path/path/header.php on line 35

Can anyone offer insight?


 Re: Strange error after moving to new server

Please use the forums if this FAQ has not been of assistance - check the read before you post as well - provide all details about your site.


 Re: Database/Site Migration/Deployment

This FAQ needs a solid updating as this question is asked frequently, and this information, while useful is a little old. If you follow a solid development process, you have a development sandbox, a staging/test sandbox, and your production site. Thus, this process becomes ever more pertinent in the process.

Here is the short story:

How to Deploy Existing Site to New Site
1. Export the entire database
2. TarGzip the entire XOOPS ROOT folder 
(include XOOPS_TRUSTED_PATH and other uploaded files not in XOOPS ROOT folder, if appropriate)
3. Setup database on new site (if not already setup)
4. Change hard-coded local URLs in data (make relative!).
5. Import database to new site
6. UnGzipTar files 
and move into place
7. Fix mainfile
.php with new database loginXOOPS root path/urletc.
8. Fix .htaccess with new domain/url (likely unneeded)


 problem after transfer site to new server

I uploaded module system again but my problem do not solve yet.
My XOOPS system is : 2.0.14
I want to upgrade to 2.0.18 but I do not access to administration of module system until I can not upgrade system and turn on Debug for take report error.

I transferred my site XOOPS with Full backup site in cpanel in old server and restore this file in new server.
site is opening but words of file Persian language in all modules show me to this format “ ?????” but my data show in site correctlly and I login as admin to site and system site give me message for welcome to site but I can not access to administration page and administration of all modules.


 Re: problem after transfer site to new server

I moved my XOOPS site from my old host to the new one. Everything works good, but when I go to the administration (backend) of the site I don't see the menu. see the image below, what I'm doing wrong?

Resized Image


 Re: problem after transfer site to new server

Are all the folders in your xoops_data folder CHMOD=777?


 Re: problem after transfer site to new server

Should not need chmod 777 if the server is configured correctly. All that is needed is writable by the server user. Chmod 775 should be the max permissions needed. chmod 777 writable by all should not be used unless a last resort for a misconfigured server that the host refuses to fix.



Who's Online

973 user(s) are online (1 user(s) are browsing XOOPS FAQ)

Members: 0

Guests: 973



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

Did you know ?

XOOPS is free software, but you can still make money with XOOPS.

Random question

How do I use Google Analytics with my website?