Changing the URL of an OP site

Events happening in the community are now at Drupal community events on www.drupal.org.
stattler's picture

Now that I've managed to convert my old site to OP I want to change the URL from beta.site.com to site.com. I tried, but got a lots of warnings.

    * warning: include_once(op_article.features.inc) [function.include-once]: failed to open stream: No such file or directory in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_article/op_article.module on line 3.
    * warning: include_once() [function.include]: Failed opening 'op_article.features.inc' for inclusion (include_path='.:/usr/local/lib/php') in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_article/op_article.module on line 3.
    * warning: include_once(op_audio.features.inc) [function.include-once]: failed to open stream: No such file or directory in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_audio/op_audio.module on line 3.
    * warning: include_once() [function.include]: Failed opening 'op_audio.features.inc' for inclusion (include_path='.:/usr/local/lib/php') in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_audio/op_audio.module on line 3.
    * warning: include_once(op_imagecrop_config.features.inc) [function.include-once]: failed to open stream: No such file or directory in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_imagecrop_config/op_imagecrop_config.module on line 3.
    * warning: include_once() [function.include]: Failed opening 'op_imagecrop_config.features.inc' for inclusion (include_path='.:/usr/local/lib/php') in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_imagecrop_config/op_imagecrop_config.module on line 3.
    * warning: include_once(op_imce_config.features.inc) [function.include-once]: failed to open stream: No such file or directory in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_imce_config/op_imce_config.module on line 3.
    * warning: include_once() [function.include]: Failed opening 'op_imce_config.features.inc' for inclusion (include_path='.:/usr/local/lib/php') in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_imce_config/op_imce_config.module on line 3.
    * warning: include_once(op_misc.features.inc) [function.include-once]: failed to open stream: No such file or directory in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_misc/op_misc.module on line 3.
    * warning: include_once() [function.include]: Failed opening 'op_misc.features.inc' for inclusion (include_path='.:/usr/local/lib/php') in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_misc/op_misc.module on line 3.
    * warning: include_once(op_slideshow.features.inc) [function.include-once]: failed to open stream: No such file or directory in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_slideshow/op_slideshow.module on line 3.
    * warning: include_once() [function.include]: Failed opening 'op_slideshow.features.inc' for inclusion (include_path='.:/usr/local/lib/php') in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_slideshow/op_slideshow.module on line 3.
    * warning: include_once(op_videos.features.inc) [function.include-once]: failed to open stream: No such file or directory in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_videos/op_videos.module on line 3.
    * warning: include_once() [function.include]: Failed opening 'op_videos.features.inc' for inclusion (include_path='.:/usr/local/lib/php') in /www/dev.nishorga.com/sites/all/modules/openpublish_features/op_videos/op_videos.module on line 3.

Certainly, the require_once files will not be in the

old path /www/dev.nishorg.com/sites/..., they should be found in the
new path /www/nishorga.com/sites/...

Now what should I actually do in order to make this transition successfully?

Comments

Have you set a base URL in

Adam S's picture

Have you set a base URL in settings.php? Have you configured your domain correctly in WHM or cpanel? Have you or any program made any changes to .htaccess rewrite rules? That's very strange because Drupal determins URL on bootstrap and passes a view global variables such as $base_url or $base_root.

For fun add these line to a block and see what you get. Or run it in the PHP code part of Devel

<?php
global $base_url;
global
$base_root;
print (
"<pre>");
print_r ($base_url . "  " . $base_root);
print (
"</pre>");
?>

And you can add this on line two of op_article.module to see what drupal is doing there.

<?php
global $base_url;
global $base_root;
print ("<pre>");
print_r ($base_url . "<br/><br/>" . $base_root);
print ("</pre>");

include_once('op_article.features.inc');

Marine job board with Drupal 7 at http://windwardjobs.com

Fixed the problem in a nonconventional way

stattler's picture

I should have mentioned that I am using nginx and I have shell access.

@adamsohn
Yes, I did try adding the base_url option in settings.php but that did not work. I've edited the path in the database itself and reimported the database but that did not help either. Finally, the non-conventional way worked, which is:

1) backed up the database using mysqldump, and then edited all the instances of dev.* to new path.
2) installed OP 1.7.1 at the new URL
3) moved the 'sites' folder to the new installation
4) imported the backed-up database using command prompt.
5) cleared cache and updated the db.

That fixed the problem.

@stattalk, that actually

irakli's picture

@stattalk, that actually sounds like a very good and conventional way to fix it :)

.............................................
http://twitter.com/inadarei

We are trying to follow the

Citizen's picture

We are trying to follow the steps you took above (stattler). I tried to install a fresh copy of OpenPublish, entered the database info at the beginning of the installation, clicked "Continue", and it came to a screen that said,

"Drupal already installed
To start over, you must empty your existing database.
To install to a different database, edit the appropriate settings.php file in the sites folder.
To upgrade an existing installation, proceed to the update script.
View your existing site."

I'm not sure how to proceed. Do you have any ideas?

Thank you in advance.

Well, what I did is installed

stattler's picture

Well, what I did is installed drupal on a new database separate from the backed-up database. Then using the shell command I replaced the contents of the new db with the old one. But before making that change I opened the old database (its a txt file) on a text editor and changed all instances of the URL that I wanted to change.

This type of work needs some advanced knowledge of drupal system as a whole and some experience of handling databases. So make backups of your folders and databases before you do any change. I am in a hurry at the moment and so I cannot write a step-by-step procedure now.

Would I empty our database

Citizen's picture

Would I empty our database through PhPmyadmin?

You may empty it but make

stattler's picture

You may empty it but make sure you have a backup in case if something goes wrong.

Ok. We have a backup. I'm in

Citizen's picture

Ok. We have a backup. I'm in phpmyadmin right now and can not find any option for emptying it. I'm sorry but I'm new to this.

I see "Structure" "SQL" "Search" "Query" "Export" "Import" "Designer" & "Operations"

Am I missing something? Or do I just need to go through and delete everything?

Oh, wait, I think I found it.

Citizen's picture

Oh, wait, I think I found it. Selecting all the boxes there's a choice at the bottom in a drop down menu to empty plus other options. Think that is it?

OpenPublish

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: