Jump to content

Moving or Copying an Invision Community Suite 3.4.x installation to a new site or new path


wimg

Recommended Posts

Moving or Copying an Invision Community Suite 3.4.x installation to a new site or new path

As I have been moving and copying entire suites to different (test) domains and/or changing set-up paths quite a bit lately, generally for testing new add-ons, and lately while testing upgrades etc. from 3.4.x to 4.0, I thought I’d share the easiest way to move things around, with as little work as possible.

Let’s take a step-wise approach (note: some of the steps are rather bigger than others ).

1. Login to your server as admin or root.
Let’s assume the old domain is called old-domain.com, etc.

2. Create the new domain, let’s call it new-domain.com, or new path, say /newpath instead of the default forum root /forums. Also for argument’s sake, let’s call the filepath /home/newdomainroot/public_html/forums for a new site, if that is the approach, to keep things as simple as possible.

3. Login to phpMyAdmin to Create a new database if you are making a copy, remember to write down the database name, say newSite_db, the sqluser, say newSite_admin, and sqluser password, say newSite_password. Logging in is good anyway, because you’ll need to do so later anyway.

4. Make a backup of the old database, from the command line, with the mysqldump command. Make sure you copy it somewhere safe. F.e.:

mysqldump –u oldSite_admin –poldSite_password oldSite_db > /backup-path/oldSite_db_backup.sql

5. Copy the entire original forums structure and contents to the new site you set up, or copy it to a backup directory, just in case. Actually, copying it to a backup directory is a good thing anyway. Rename the directory if that is what you were aiming to achieve anyway. I use the Linux cp command to achieve this, followed by chown to change the owner to the correct new owner.

6. In case you are creating a new test site, or moving the old domain to a new one, import the backup of the database you created into the new database you created in step 2, using the mysql command from the command line. F.e.:

mysql –u newSite_admin –pnewSite_password newSite_db < /backup-path/oldSite_db_backup.sql

You can skip this step if all you want to do is change the path of the installation in the same or old domain structure.

7. Create a backup copy of conf_global.php, which resides in the forums root directory, just in case.

8. In the new directory structure, or on the new domain, edit conf_global.php to reflect the changes.

A typical conf_global.php may look as follows:

<?php

$INFO['sql_charset']		=	'';
$INFO['sql_database']		=	'oldSite_db';
$INFO['sql_debug']			=	'0';
$INFO['sql_driver']			=	'mySQL';
$INFO['sql_host']			=	‘localhost’;
$INFO['sql_pass']			=	'oldSite_password';
$INFO['sql_tbl_prefix']		=	'ibf_';
$INFO['sql_user']			=	'oldSite_admin';
$INFO['mysql_tbl_type']		=	'MyISAM';
$INFO['board_start']		=	'1121643890';
$INFO['board_url']			=	'http://www.old-domain.com/forums';
$INFO['installed']			=	'1';
$INFO['php_ext']			=	'php';
$INFO['safe_mode']			=	'0';
$INFO['banned_group'] 		= 	'5';
$INFO['admin_group']		=	'4';
$INFO['member_group']		=	'3';
$INFO['guest_group']		=	'2';
$INFO['auth_group']			=	'1';
$INFO['use_friendly_urls']  =   '1';
$INFO['_jsDebug']			=	'0';

define( 'IN_DEV', 0 );
?>

Now change all the parameters which contain oldSite to show newSite like so:

<?php

$INFO['sql_charset']		=	'';
$INFO['sql_database']		=	'onewSite_db';
$INFO['sql_debug']			=	'0';
$INFO['sql_driver']			=	'mySQL';
$INFO['sql_host']			=	‘localhost’;
$INFO['sql_pass']			=	'newSite_password';
$INFO['sql_tbl_prefix']		=	'ibf_';
$INFO['sql_user']			=	'newSite_admin';
$INFO['mysql_tbl_type']		=	'MyISAM';
$INFO['board_start']		=	'1121643890';
$INFO['board_url']			=	'http://www.new-domain.com/forums';
$INFO['installed']			=	'1';
$INFO['php_ext']			=	'php';
$INFO['safe_mode']			=	'0';
$INFO['banned_group'] 		= 	'5';
$INFO['admin_group']		=	'4';
$INFO['member_group']		=	'3';
$INFO['guest_group']		=	'2';
$INFO['auth_group']			=	'1';
$INFO['use_friendly_urls']  =   '1';
$INFO['_jsDebug']			=	'0';

define( 'IN_DEV', 0 );
?>

Do note that if you used a different prefix, which here is ibf_, that will look differently.

In case you only wanted to change the root path, all you need to change is the board_url to reflect the correct new root path, so that would make conf_global look as follows (only 1 change):

<?php

$INFO['sql_charset']		=	'';
$INFO['sql_database']		=	'oldSite_db';
$INFO['sql_debug']			=	'0';
$INFO['sql_driver']			=	'mySQL';
$INFO['sql_host']			=	‘localhost’;
$INFO['sql_pass']			=	'oldSite_password';
$INFO['sql_tbl_prefix']		=	'ibf_';
$INFO['sql_user']			=	'oldSite_admin';
$INFO['mysql_tbl_type']		=	'MyISAM';
$INFO['board_start']		=	'1121643890';
$INFO['board_url']			=	'http://www.old-domain.com/newpath';
$INFO['installed']			=	'1';
$INFO['php_ext']			=	'php';
$INFO['safe_mode']			=	'0';
$INFO['banned_group'] 		= 	'5';
$INFO['admin_group']		=	'4';
$INFO['member_group']		=	'3';
$INFO['guest_group']		=	'2';
$INFO['auth_group']			=	'1';
$INFO['use_friendly_urls']  =   '1';
$INFO['_jsDebug']			=	'0';

define( 'IN_DEV', 0 );
?>

9. Having done the above, we can now continue and tackle the database, so use phpMyAdmin to open the new database, or the old one which uses the forums in a new path, and open the SQL query box. In the SQL box, copy the script below, ideally in chunks of 5 commands r less, as that will show progress for all commands, rather than just for the last one.

In case you are moving everything to a new domain, or creating a copy in a new domain, do the following, obviously replacing old-domain.com with your current domain name and tld, and new-domain.com with the new ones.

UPDATE `ibf_blog_comments` SET comment_text=REPLACE(comment_text, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_blog_entries` SET entry=REPLACE(entry, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_cal_events` SET event_content=REPLACE(event_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_ccs_custom_database_1` SET field_2=REPLACE(field_2, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_ccs_custom_database_2` SET field_11=REPLACE(field_11, 'http://www.old-domain.com', 'http://www.new-domain.com');

UPDATE `ibf_core_editor_autosave` SET eas_content=REPLACE(eas_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_core_share_links_log` SET log_url=REPLACE(log_url, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_downloads_files` SET file_desc=REPLACE(file_desc, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_forums` SET rules_text=REPLACE(rules_text, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_inline_notifications` SET notify_title=REPLACE(notify_title, 'http://www.old-domain.com', 'http://www.new-domain.com');

UPDATE `ibf_inline_notifications` SET notify_url=REPLACE(notify_url, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_member_status_replies` SET reply_content=REPLACE(reply_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_member_status_updates` SET status_content=REPLACE(status_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_nexus_packages` SET p_desc=REPLACE(p_desc, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_profile_portal` SET pp_about_me=REPLACE(pp_about_me, 'http://www.old-domain.com', 'http://www.new-domain.com');

UPDATE `ibf_profile_portal` SET signature=REPLACE(signature, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_rc_reports` SET report=REPLACE(report, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_rss_export` SET rss_export_image=REPLACE(rss_export_image, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_message_posts` SET msg_post=REPLACE(msg_post, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_posts` SET post=REPLACE(post, 'http://www.old-domain.com', 'http://www.new-domain.com');

The changes to ibf_message_possts and ibf_posts take the most time, BTW, as here you’ll find most stored links to content etc.

If all you want to do is change the actual domain structure, instead of using old-domain.com and new-domain.com, as per the example, you need to use old-doamin.com/forums and old-domain.com/newpath. I’ll leave you to work this out.

Next we need to address the configuration in the database, and yes, it is possible to do so from the ACP, but that is very time consuming and prone to errors. Hence I’ll tackle this from the database side as well.

So you now copy the following SQL scripting commands into the SQL query box:

UPDATE `ibf_core_sys_conf_settings` SET conf_value=REPLACE(conf_value, 'old-domain.com', 'new-domain.com');
UPDATE `ibf_core_sys_conf_settings` SET conf_value=REPLACE(conf_value, '/old-uploads-path', '/new-uploads-path');
UPDATE `ibf_core_sys_conf_settings` SET conf_value=REPLACE(conf_value, '/old-downloads-path/', '/new-downloads-path/');
UPDATE `ibf_core_sys_conf_settings` SET conf_value=REPLACE(conf_value, '/old-domain-rootpath/', '/new-domain-rootpath/');

Just like above, if you are using only a new domain structure, rather than a different domain altogether, all you need to do is use old-domain.com/forums and old-domain.com/newpath. You may have to change the last 3 script commands as well as a result.

A few more items which may require changing, follow now:

UPDATE `ibf_core_sys_conf_settings` SET conf_value=REPLACE(conf_value, 'old.email.adress@old-domain.com', 'new.email.address@new-domain.com');
UPDATE `ibf_core_sys_conf_settings` SET conf_value=REPLACE(conf_value, 'anyother.old.email.adress@old-domain.com', 'anyother.new.email.address@new-domain.com');
UPDATE `ibf_sys_core_conf_settings` SET conf_value=REPLACE(conf_value, 'http://www.old-domain.com/.../rules-and-guidelines.html', 'http://www.new-domain.com/.../rules-and-guidelines.html');
UPDATE `ibf_core_sys_conf_settings` SET conf_value=REPLACE(conf_value, 'Old Home Name', 'New Home Name');
UPDATE `ibf_core_sys_conf_settings` SET conf_value=REPLACE(conf_value, 'Old Site Name', 'New Site Name');

This in order to change any email address used in the system for different reasons, and similar for the home name used, and the site name used.

The last changes to be made to the database are dependent on any 3rd party add-ons you may have installed, and which also require a few changes. F.e., we use Classifieds, Advanced Adverts, Global Sidebars, and Fusion Menu.
The changes for these may be addressed as follows:

UPDATE `ibf_classifieds_items` SET description=REPLACE(description, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_classifieds_questions` SET question=REPLACE(question, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_classifieds_questions` SET answer=REPLACE(answer, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_dp3_adv_adverts` SET a_content=REPLACE(a_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_dp3_adv_templates` SET t_content=REPLACE(t_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

UPDATE `ibf_dp3_gs_adverts` SET a_content=REPLACE(a_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_fusion_menus` SET url=REPLACE(url, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE `ibf_fusion_menus` SET icon=REPLACE(icon, 'http://www.old-domain.com', 'http://www.new-domain.com');

As before, change old-domain.com to the current domain name, and new-domain.com to the new one, and in case of just a domain structure change, make that old-domain.com/forums and old-domain.com/newpath.
For other add-ons you may have to investigate yourself what requires changing.

With all of this out of the way, we can now get to the last few steps.

10. Log in to the ACP.
Go to Look & Feel (Skin Management) and next in Look & Feel – Template Tools do
- Rebuild all (mark all tick boxes, and click on Rebuild)
- Select all skin sets, and click on Recache Skin Sets
- Clean Up Template Databases (click Run Tool)

Next go to System – Modules and Applications, and click Recache Apps & Modules.

Finally, go to System – Tools & Settings – Cache Management and
- Clear Cached Posts (All)
- Clear Cached Signatures (All)
- Rebuild FURL Cache
- Rebuild Global Caches Cache
- Recache All

That should fix most, if not all path and main problems with a Invision Community copy or move, or a domain restructure. There are a few minor items which may also need to be addressed, but that will vary from site to site. They should not interfere with running or testing for that matter, however.

Now just log in to the new site, or the old site with new structure, and all should be well.

With the set-up described above, I am now capable of moving an entire site with over 50GB file contents and a database of over 6 GB to a test site on the same server in less than an hour, provided I do not get interrupted. This used to take me several days to more than a week in the past, to about a day half a year ago, with a significant improvement using all of the steps above.

I hope this may be useful to someone.

Kindest regards, Wim

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...