default userpic

Importing old entries, possible to specify URLs?

Vote 0 Votes

I want to import old entries from an earlier version of my blog. I'd like to maintain their existing URLs. How would I do this? The Movable Type import format doesn't have a field like that.

Reported on Movable Type 4.3

10 Replies

| Add a Reply
  • Pretty obvious, really.

    An entry url will have the following components.

    1. domain name: http://www.yoursite.com/
    2. your folder or category path: /books/reviews/
    3. your file basename : midsummer_nights_dream
    4. your file sufix: .html or .php or whatever

    So your complete entry url looks like this:

    http://www.yoursite.com/books/reviews/midsummer_nights_dream.php
    

    In your new blog, you have to make sure that each of these strings is the same as earlier. How?

    1. Keep your domain path/site path the same: http://www.yoursite.com
    2. keep your archive mapping the same. This is done when you create or modify your archive templates. See this.
    3. Keep your file basename the same. If the older entries had 15-character filenames, so should the new ones.
    4. Keep your file suffix the same. If you earlier defaulted to html files, stick with that. It's possible to do a double-flip, so that new files with a .php suffix point to the old .html files, or even for the new .php files to "include" the content of the old .html files, but that can be a pain

    Beyond that there is nothing that MT (or anything else) can do for you. If you change any of these parameters, MT obediently follows your changes. Change your domain, category, mapping and MT will render what you want it to render. It's up to you to be consistent. That's your job, not MT's.

    • "Pretty obvious, really."

      Why do have the half the responses here begin with insults? It's particularly obnoxious when the respondent didn't understand the question and offers useless advice.

      Your response doesn't help at all. My old URLs don't follow the format you describe. They're numbers: 00000001.html, 00000378.html, etc. My question was very clearly stated -- how to keep my *old* URLs rather than have MT automatically assign new ones.

  • I posted a reply and it's gone into some admin dustbin. Wait for approval please.

    But this you should know. URLs are NOT data. They are what MT renders to point to your data. If you change your set up (domain, categories, folders, pagenames, entry names, number of characters in an entry, archive mapping), the URLs will obediently change. That's exactly what any CMS should do and what MT has always done, beautifully.

  • What you are trying to do is possible!

    What you need to do is to *hack* a movable type source file responsible for the data export and to include there the "basename" field data.

    When you will import your blog data with the basename field, your links would like exactly the same that on your older blog.

    The only thing you will have to pay attention to is the URL pattern setting for each template type to be the same as on your old blog (including the dashes, underscore or normal dash)...

    If you need professional consultancy for this item, I would be glad to work with you.

  • @Su, sorry, didn't know that.

    @hound76. How is "pretty obvious" an insult or obnoxious? Your post did not indicate anywhere that you have number-padded URLs. What you said was this:

    I want to import old entries from an earlier version of my blog. I'd like to maintain their existing URLs. How would I do this? The Movable Type import format doesn't have a field like that.

    You didn't say what the URLs were/are/should be.

    "Keep the old URLs" means absolutely nothing if you're putting that data into MT and have it work on that data. To be clear: You want MT to take all your old data and keep the old URLs and do nothing with or to them. Yet you want MT to index all the data linked to the "old URLs" for searching and listing. And you want MT to not touch the archive mappings for the "old URLs".

    That just won't work, because archive mapping is what MT does with all data. It parses its location as you decide and spits out the result. That's "pretty obvious".

    Mihai's solution will do it but he's saying essentially the same thing: keep your basenames and mappings the same and everything will work. That's pretty obvious too, and has been since MT's very early days.

    Exporting entries does export the basename and ties it to the entry data. So when you import, your entry data XXX will be tied to a basename 000001.html and so on. After that, so long as you're careful with your archive mapping, you should be okay.

    Incidentally, this does work. I just tried it between an old MT3.2 install and a new MT4.31 install. It all went through. Data and basenames went out and the old 00001234.html files were ported over correctly.

    I'm sorry if you find this offensive, but I find your response offensive. I took the time to try and help. No thanks wanted or necessary, but do at least try to keep it civil. You might have just responded by saying no, that's not what I mean. In fact, it's you who hasn't cared to try and understand the suggestion.

    And that's what everything here is: a suggestion. Like it, use it, don't like it, don't use it. Your call. Sledging someone who took time off to help and making egregious comments about the forum doesn't help. It's a waste of time.

    Ordinarily I wouldn't have bothered to respond, but perhaps this will help someone else some day perhaps. Hence this, and that's the only reason.

    And no, "half the posts" do not start with an insult.

    That's it for this from me. No more. Say, do what you will. I'm out of here.

  • Your original response started with a "that's a stupid question" putdown, then demonstrated that you didn't understand the question. That's obnoxious. Sorry if you're offended.

  • "Exporting entries does export the basename and ties it to the entry data. So when you import, your entry data XXX will be tied to a basename 000001.html and so on."

    Unfortunately I don't have the old entries in MT Import/Export Format. They're just static HTML files at this point. I'm willing to put the entries into MT Import/Export Format by hand. But I don't see any way to specify a basename for individual entries.

    I don't expect Mr Patel to respond, but I'd be very grateful for any help (preferably without telling me how stupid I am for asking, but I'll take what I can get at this point)

    • I'm willing to put the entries into MT Import/Export Format by hand. But I don't see any way to specify a basename for individual entries.

      Basenames weren't part of the original mtimport format, among many other eventual problems. It was added later, though never really documented any place useful. An entry block will accept a BASENAME field, that functions just like the others, so roughly:

      TITLE: Your Entry Title
      BASENAME: your_entry_title
      DATE: etc

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

695 2910

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 567

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012