Help - Search - Members - Calendar
Full Version: Individual entries ID re-start
Movable Type Community Forum > Additional Resources > Tips and Tricks
christina
I'd like to know more about this. does this mean your titles can no longer have spaces? are spaces autotranslated into underscores?
bmk
The top part of this conversation took place pre-2.0.  That was when the entries exported in a different order each time.

With 2.0 entries export in order.  I haven't imported a set of posts back in, but I am thinking that since they are in order now, they will import in the same order.  

So even though the EntryID is not riding along with the post, it should get the same ID as it had before.  Yes?

Brenna
lynda
Ahhh.  I wasn't thinking long-term enough.  I knew you were planning on making a better backup system, but it wasn't occuring to me in this case.

smile.gif
justagwailo
Hi y'all.  While converting my blog from the venerable Blogger system to up-and-coming Movable Type, I got frustrated with how long the conversion was taking, and stupidly stopped the process.  Upon realizing that I made a mistake, I re-started the process, only to find my MT Entries start at ID #304.  Not only that, but they are in reverse order (e.g. #304 is the last post written, while #738 was the first post written).  

What I would like is to have post #1 be ID #1.  What, other than exporting (and backing up), saving my templates, deleting the blog, and then re-importing them, what options do I have?  (I have the luxury of doing this now, because the major search engines don't seem to have caught on to my new URL structure)

Richard
Just A Gwai Lo
justagwailo
Yes, purely aesthetic reasons.  

It's also partly because I would like to start another blog using the same installation of MT, but start with #1.  It's partly because the newer blog will contain my last name, whereas the old one hides it (I'd rather my in-real-life friends don't come to conclusions about the two sites being 'connected').

Well, it's not that big of a deal.  Just curious, really.  Thanks for your time Ben.
christina
it seems to me that the export could include the entry ID. Then, upon re-import, maybe perl could patternmatch the two entries. upon finishing the export, it could offer a page of all the mismatched entries, allowing you to pick on and discard the other, or pick one and give the other a new entry number.


thoughts?
bmk
Before MT 1.3, this numbering thing drove me crazy.  It's all good now, thanks to Archive File Templates and my new best friend dirify!  You don't have to use the MTEntryID for the archives any more, you can use the entry title.  

Using this for your Individual Archive File Template:
CODE
<MTEntryCategory dirify="1"$>/<$MTEntryTitle dirify="1"$>.shtml

You end up with a url like this:
CODE
http://www.mngeo.com/geo/archive/found/trip_trap.shtml

Instead of this:
CODE
http://www.mngeo.com/geo/archive/000248.shtml


Also, if your entries are exported and reimported, they may have different Entry ID's, but the permalinks will have the same name.

Awesome, works for me!
Brenna
I geocache.
bmk
Yeppers!  Dirify is so, so cool.  Here's the snippet from the manual:

dirify
When set to 1, ``dirifies'' the tag value. This means that the value of the tag is made suitable for usage in a file or directory name: the value is converted to lower case, strange characters are stripped (where strange is defined as not included in the following set: alphanumeric characters, underscore (_), and whitespace), and whitespace is then converted to underscores (_).
For example, if the value of the tag without this attribute were Foo "Baz" is Bar!, the dirified version would be foo_baz_is_bar.

Brenna
I geocache.
plebian
QUOTE

"For example, if the value of the tag without this attribute were Foo "Baz" is Bar!, the dirified version would be foo_baz_is_bar."

So, if I have the same title for 2 diff. entrie, then is dirify going to cause the new entry to overwrite the old one?

thanks
lynda
Well that hardly seems like the best solution then, naming the file after the title.  With over 800 entries, I'm sure I've used the same title more than once.

Maybe adding the date in front of the post could clear it up, but I'm really anal about stuff like this and I just couldn't have archives leading to pages looking like 0408bored_again.php

I agree that the best solution would probably be to find a way to export the entry IDs as well.  If you're going to have a function existing to link something, you need a method to export while maintaining the same links.   Otherwise, the exporting process isn't really very helpful at all.
lynda
QUOTE
So even though the EntryID is not riding along with the post, it should get the same ID as it had before.  Yes?

Only if you have only one blog.  If you have more than one blog, entry IDs are being spit out in order of the posts made and there's no way to import in that interlaced order without a huge headache.
btrott
Lynda: The suggestion of using the date is actually a very good one; it may not appeal aesthetically smile.gif, but it will definitely cut down on overwriting files.

As for the exporting of the ID: we have not done this yet primarily because we never planned for the exports to be a complete restorable backup of the database--it was meant for transferring data between another system (eg Blogger or GM) or saving your own entries and comments.

Exporting and importing the ID is not a completely simple matter: because exports have primarily been used to transfer data between two systems, people might get the wrong idea that if they export the ID, the entry will *always* get the same ID when imported into another system. But that cannot be the case, because in another system, an entry with that ID might already exist.

So: we do plan to add the ability to do a complete backup of the entry database (and all of the other databases). This will be cross-blog, and will contain all of the entry fields, including ID. But the above rationale is why we're not adding it to the exports.
kadyellebee
Another way to that hasn't been mentioned if you'd really like to cut the entry numbers out of your scheme....  Use daily archives instead.

Set up an Daily Archive File Template to put your files into directories based on the year, month, and then date file:
CODE
<$MTArchiveDate format="%Y/%m/%d.html"$>


Modify your permalink to point to the title of that days post instead of the post id number:
CODE
<a name="<$MTEntryTitle$>"></a>

and
CODE
<a href="<$MTBlogArchiveURL$><$MTEntryDate format="%Y/%M/%d.html"$>#<$MTEntryTitle$>"><$MTEntryDate format="%B %e, %Y"$></a>


I *think* this would take out all mention of the entry id if you do a scheme like this, and then you'll be able to be orderly with your organization of the posts but without the stress of getting your entry ids out of order!!

Kristine
btrott
There is no way to reset the ID counter, other than trashing your DB files and starting over.

But I am curious about why you are concerned about this--is it purely for aesthetic reasons? Because MT itself doesn't care in the least what the ID of an entry--IDs are not used for ordering entries *at all*. All ordering is done based on the authored on date; and since MT lets you *change* the authored on date, the authored on date is not really connected at all to the ID.

So it really doesn't matter if entry ID 1 is the first entry or the last.
theonetruebix
QUOTE
What I would like is to have post #1 be ID #1.  What, other than exporting (and backing up), saving my templates, deleting the blog, and then re-importing them, what options do I have?


I would dearly love to have this feature. The problem, when getting Blogger posts into MT, is that while Blogger lets you order posts chronologically within days it lists the days themselves in reverse chronology. If one is doing Individual archiving with MT, this means that the most recent post date-wise that you are pulling in from Blogger entries gets a filename of 000001 -- a filename that should logically go to the first post chronologically.

Basically, the process to import Blogger posts into MT needs to (1) Have the user export the posts in reverse chronology (the opposite of what it is now) and then (2) to go through the file of all the Blogger posts in reverse, so that the first post chronologically gets the lowest available Individual archive filename.
btrott
Yes.
bmk
Oh yes, this is true.  :)

I run one database for my big blog and one database for my million other blogs.  I didn't consider that.  :)

I'm currently using the "entry title as the file name" method, on just about everything.  The links are perfect every time, but you're quite right that you have to choose entry titles carefully.

It would be a great addition to be able to export the ID.

Brenna
lynda
Thanks for the suggestion, Kristine.  :)

With my layout, daily archives would be messy.  I don't like popup comments and want to keep them inline.  Sometime the comments can get quite long, which would be just ugly on a daily archive page.
kadyellebee
That's true, Lynda wink.gif  But not everyone is prolific in their posting as us LOL!  For most several-posts-a-day people, this might work okay.  :D

Kristine
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.