1
antifmradio
Moving Xoops from /subdirectory/ to /root domain folder

So i have my XOOPS installation almost complete
i was setting it up in a subdirectory to keep it out of the public eye while i develop things and do tests.

its currently located at
www.grooveclip.com/groove/

i want to drag the contents of GROOVE one folder upwards in the hierarchy so it can be found at
www.grooveclip.com

im sure when hte SQL commands ran, they spit out data to the sql sever tables saying
"such and such data + text inserted on page WHATEVER.php
at location /rootfolder/groove/modules/

if i simply move the contents from /GROOVE/
to the root folder
i am sure all the linking in the menu and so on
(pics, video, and other linking, polls etc)
simply wont work



How can i move this?


I was thinking i could just drag it all one folder outwards
then goto my sql database
export it
open it with a text editor
tell it

FIND / REPLACE
Find = htdocs/groove/
Replace with htdocs/

then upload the sql again after i had already emptied the tables

2
McDonald
Re: Moving Xoops from /subdirectory/ to /root domain folder
  • 2007/8/22 13:21

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


As far as I can remember you only have to modify your url in the file mainfile.php.
You might want to check the html-files of your theme and if you're using the module MultiMenu you might want to check this too.

3
kc0maz
Re: Moving Xoops from /subdirectory/ to /root domain folder
  • 2007/8/22 13:41

  • kc0maz

  • Quite a regular

  • Posts: 216

  • Since: 2005/4/18


You also need to change the Xoops_Root_Path to the new file location on the server. This should be around line 34.
Some dream of success, while others wake up and work for it.
--unknown

4
antifmradio
Re: Moving Xoops from /subdirectory/ to /root domain folder

thanks
to test it
(And this is for anyone else reading it)

I make a copy of my mainfile.php and save it somewhere

then ill just download my entire XOOPS installation from FTP
ill then UPLOAD it into the root directory of the domain (one folder upward)
then ill goto THAT mainfile.php and edit the info

If it all works correctly
then i wont need to do anything else but delete the old directory

If it doenst work correctly
i still have all the original files online intact
so i would only have to delete all the root directory (to domain space) files and their folders

in this case with the accpetion of deleting my /GROOVE/ directory

Ill let ya know

5
rlankford
Re: Moving Xoops from /subdirectory/ to /root domain folder
  • 2007/8/22 14:41

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


Yes. All this should get you very close. But one thing that might drive you nuts is the fact that if you have lots of posted content, you might have lots of links (images, hyperlinks, etc) that were created in all that content that point to your URLs in their old location.

So if, for exmaple, your site were "http://www.i_am_cool.com/xoops", and you were moving it to "http://www.i_am_cool.com", then you might expect to find lots and lots of places where the "/xoops" part is hard coded in your database.

You can fix this though. Here is a sample script that you can save to your server's root directory and run once (after moving all your files) to correct this issue:

<?php
$dbusername 
'root';
$servername 'localhost';
$dbpassword 'Password goes here';
$dbname 'xoopsdata';
$replaceThis "'/xoops'";
$replaceWith "'/'";


$chandle mysql_pconnect($servername$dbusername$dbpassword
      or die(
"Connection Failure to Database");

$result mysql_list_tables($dbname);
while (
$row mysql_fetch_row($result))
{
      
$table_name$row[0];
      
$fields mysql_list_fields($dbname$table_name);
      
$numcolumns mysql_num_fields($fields);
      for (
$i 0$i $numcolumns$i++)
      {
           
$field_name mysql_field_name($fields$i);
           
$sql "update ".$table_name." set ".$field_name;
           
$sql .= " = Replace(".$field_name.", " $replaceThis ",";
           
$sql .= $replaceWith ")";
           print 
$sql."<br />";
           
$sqlresult mysql_query($sql);
      }
//end for
}//end while
mysql_free_result($result);
print 
"DONE!";
?>


Of course, you'll need to fill in the details at the top of the script like user name, db name, password, etc. You'll also want to be sure to remove this script from your web server after you've run it!

Note: This script's operation is irreversible so be careful what you replace! If your replaceThis string is too vague, then you'll probably end up breaking a lot of things that you didn't mean to! For this reason, it's really important that you back up your database before running this script!

P.S. Bonus points for altering the script to show you what it will do before making it actually do it! That way you can sort of check to ensure that the 'hits' you're getting are the ones that you want to get.

Login

Who's Online

154 user(s) are online (103 user(s) are browsing Support Forums)


Members: 0


Guests: 154


more...

Donat-O-Meter

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

Latest GitHub Commits