moving to another server/#3643

Jan 3, 2007 / pixtur
Jan 6, 2009 / phsouzacruz
 

Attached files

No files uploaded
 
Because we move streber.pixtur.de to www.streber-pm.org we wrote this small guide on how to move a streber installation.

1. Copy your project filesπ

The only relavant data that is not stored in the database is located in the _files directory. Make a complete copy of this directory.
'_rss' directory content is generated on demand.
If you have problems reading the files, check the file permissions. Files with 0600 are only readable by the webserver (wwwrun) . I used a small hack like the following script to fix this.

from makepub.php

<?php
# makes all files in a directory readable. 
# Read more at http://www.streber-pm.org/3643


function listdirs($dir) 
{
    $dirs= glob($dir . "/*");
    if(count(dirs)) {
        foreach($dirs as $file) {
            echo $file."<br>";
            if(is_dir($file)) {
                chmod($file, 0777);
                listdirs($file);
            }
            else {
                chmod($file, 0644);
            }
        }
    }
}

listdirs(".");

?>

Make use

2. Copy customize.inc.phpπ

If you made any fancy stuff in your customize.inc.php, you should make a backup of this file.

3. Ignore `_settings/` and `_tmp/`π

Since all data in this directory are database specific, you better just ignore these files.

4. Backup your databaseπ

Either with mysqladmin or with the _settings/db_backup.php.
If your database already got too large (like 1mb gzip compress) myPHPAdmin might break because not enough memory.

On the new serverπ

1. Install the latest version π

Including a database

2. restore filesπ

  • overwrite customize.inc.php
  • probably adjust .htaccess
  • upload _files directory

3. restore databaseπ

This is the tricky part:
  • use myPHPAdmin to drop all tables
  • use myPHPAdmin to restore original content. If this is too large, you can use the install/db_backup.php script:
  • Adjust the account settings and filename of your uncompressed sql-file in following block:

from install/db_backup.php

if($dumper->connect(
        'localhost',	# hostname
        'user',	# DB-username
        'password',	# DB-password
        'database'	# DB-name
)) {
   #$dumper->dump();
   #$dumper->executeFromFile("somefile.sql");  # <--- uncomment this line
}
  • then upload the sql-file and directly request the script

Redirect to new serverπ

for convenience you should add a .htaccess file to redirect all requests to the new server:

from .htaccess

RewriteEngine on

RewriteRule ^(.*)$ http://www.streber-pm.org/$1 [L]


No Comments