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:
$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."
";
$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.