Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => SMF Feedback and Discussion => Topic started by: Toadmund on January 30, 2009, 06:39:02 PM

Title: Update backup database with your new url (path) using Linux Text Editor.
Post by: Toadmund on January 30, 2009, 06:39:02 PM
I am glad I discovered this amazing button in Linux text editor! :D
Note:My old path: /freshdumps.com/forums/.........

On the top right of the editor there is a button called 'replace'
(of course your backup database text is in the editor)
So I stuck 'forums' into the 'search for' box.

In the 'replace with' box I put 'forum'
Then I hit 'replace all'

Now every path in the file is now:
/freshdumps.com/forum/.........

Which is what I want, repair_settings.php did not fix my old board urls as long as 'pretty urls' was running.
Now with a fresh install, my url-fixed DB re-integrated, everything is peachy with my new path, oh how I hated choosing 'forums' instead of 'forum', just had to do something about that.

I would assume that the MS text editor may have a similar feature, not sure, I havent used windows for almost, well, since Ubuntu 'edgy'

I hope somebody is helped by this post.
Title: Re: Update backup database with your new url (path) using Linux Text Editor.
Post by: IchBin™ on January 30, 2009, 06:51:28 PM
vi Settings.php
:1,$s/forum/forums/

That'll do the trick in vi. :D
Title: Re: Update backup database with your new url (path) using Linux Text Editor.
Post by: 青山 素子 on January 31, 2009, 12:11:30 AM
Quote from: IchBin™ on January 30, 2009, 06:51:28 PM
vi Settings.php
:1,$s/forum/forums/

That'll do the trick in vi. :D

I generally use:

:g/originaltext/s//newtext/g

That should work for sed with only a little change.