Prime 357

We'll learn something

Site Menu

  • Home
  • Recent Posts
  • Forum
    • Programming Languages
      • C++
    • Website Design & Content Management
      • Wordpress >> Drupal
  • Blogs
  • Topics
    • C++
    • Changing hosts - Dummies Guide
    • Wordpress >> Drupal
  • Download Centre
  • Contact us
Home Forums Website Design & Content Management Systems Wordpress to Drupal


Image - OpenID

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password

Navigation

  • Recent posts

Topics

  • C++ (The Book)
  • Changing Hosts - a Dummies Guide
  • Wordpress to Drupal

Recent comments

  • Got it solved This page here
    36 min 23 sec ago
  • Links working
    1 day 24 min ago
  • Thanks... I may be able to
    1 day 6 hours ago
  • 3306 by default
    1 day 16 hours ago
  • Is this the right place to
    1 day 16 hours ago
  • Figured
    3 weeks 6 days ago
  • I'm guessing at this stage
    3 weeks 6 days ago
  • WordPress MU?
    4 weeks 1 hour ago
  • Thanks
    10 weeks 1 day ago
  • I'm running the conversion
    11 weeks 4 days ago

New forum topics

  • What should the port number be
  • WordPress MU?
  • funny little bug in mac version
  • Error: Unable to Insert into Node_revisions table when converting from wordpress 2.6.0 to drupal 6.4
  • index.php?
more

Who's online

There are currently 0 users and 0 guests online.

Who's new

  • oODeathStormOo
  • leruffiant
  • Emtee
  • mnogodet
  • ZioMimmo

Search and Replace - did the job

3 replies
Thu, 15 May, 2008 - 00:24
Steve
Joined: 27 Mar 2008
User offline. Last seen 10 hours 17 sec ago.

My other personal blogging site use to reside within a sub-directory of the domain - http://superjacent.net with no clean url's. A few days ago I moved the drupal installation back to the root of the domain and turned on clean url's. The site is now accessed at http://superjacent.net.

Now, this is where the 'Search and Replace' function came in very handy. Quite a few of my posts contained internal links to other pages of the site. Those links included a reference to the sub-directory cms and the non clean url ?q=node\. References to most images were relative, adopting this format ./files/image002.jpg.

Using the Search and Replace utility I was able to:

Replace /cms/?q=node/ with /node/, and
Replace /cms/node/ with /node/, and
Replace ./files with /files.

The first two replacements were not absolutely necessary as I've got RewriteRules in place but the third was necessary as the images were no longer displayed with the ./ (dot slash) relative reference, due to there no longer being a sub-directory in use.

The upshot is, it worked. As you can imagine, you have to be very careful with your selection of text to be replaced and so I highly recommend backing up first. I'll say it again, BACKUP FIRST.

n/a
Top
  • Login or register to post comments
  • 522 reads
Wed, 21 May, 2008 - 21:43
#1
DrupalUser
Joined: 20 May 2008
User offline. Last seen 5 weeks 6 days ago.
Replace <!--more--> with <!--break-->

Another useful tip. Use the replace feature to replace all the <!--more--> tags with Drupal's version <!--break-->.

These are the teaser tags.

Top
  • Login or register to post comments
Wed, 21 May, 2008 - 22:22
#2
Steve
Joined: 27 Mar 2008
User offline. Last seen 10 hours 17 sec ago.
Thanks DU it certainly

Thanks DU it certainly replaces the phrases correctly but the problem is that the effect of enforcing the teaser is not done. The teaser and main body of the post are two separate fields. All that happens is that the replacement takes place and nothing else. After this change, if you were to then edit the page within Drupal (without editing anything) and then save, the effect of the 'break' command will take effect.

This though, has highlighted an area for improvement. It shouldn't be too difficult to account for this.

Steve
My running website

Top
  • Login or register to post comments
Tue, 19 Aug, 2008 - 11:06
#3
Steve
Joined: 27 Mar 2008
User offline. Last seen 10 hours 17 sec ago.
Came to the rescue

The Search and Replace feature of the converter has come to my rescue yet again.

To cut a long story short I've changed this site from prime357.org to prime357.net. In the process I detected that all internal links and images were referenced in absolute terms and not relative. This meant that images were not displayed and links were not valid.

I had two choices, either replace all the absolute links with new absolute links, therefore accounting for the new site or replace them with relative links. I opted for the second option, relative links. I recall that I enforced absolute links months ago as some rss readers wouldn't correctly display relative links, now I don't care.

Here are the search and replace strings used to change from absolute to relative references:

Search for : <a href="http://prime357.org/
Replace with : <a href="/

Search for: <img src="http://prime357.org/
Replace with : <img src="/

Version 1.04 correctly made the above replacements and all images and links are correctly implemented.

During this exercise I noticed I hadn't included a search and replace feature for comments. I quickly slapped together functions to address comments, Version 1.05 (yet to be released), and all replacements went through smoothly.

As regards the look and feel of the Search and Replace feature, I agree, it's not the best, but it gets the job done. I will be addressing the look and feel of this feature in the next version or two.

Oh, nearly forgot though I've mentioned this before, BACKUP first, it can be a very dangerous feature.

Steve
My running website

Top
  • Login or register to post comments

 Subscribe in a reader

free hit counter


RoopleTheme