We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14385
    • 31 Posts
    Is it possible to change the link id of a page? and if so how?

    Basically due to me fannying about alot i have link ids all over the place like homepage is 12 then the next is 24 etc etc. Now my site is finished i’d like to have them all neat and tidy

    i.e

    Home 1
    Contact me 2
    portfolio 3
    etc 4
    etc 5.

    Hope you get what im trying to say.

    Thanks in advance,
    Jodie. cool
      • 22303 MODX Staff
      • 10,725 Posts
      There’s really no easy way to do it. These values are assigned to the records by the database, and are used to represent those rows in other tables that store data related to those pages. You’d have to write a migration script to dump the data, reset the auto_increment value and reinsert the data without the id column into the site_content table, and then find every other table with a reference to the site_content primary key, and map the old key value to the new one you’ve assigned. In other words I don’t recommend it, unless you have some very keen SQL skills.
        • 14385
        • 31 Posts
        My SQL is pretty poor tbh im more xhtml, php, css and js minded.

        Do you think i’d be better off backing up my code to txt files and then doing a fresh install? At least that way i could insert the data as i want it ordered.

        Oh and thanks for the quick responce.
          • 22303 MODX Staff
          • 10,725 Posts
          If all you’ve done is add content to pages and have avoided adding keywords, metatags, TV’s, and all sorts of other stuff that can be related to pages in MODx, just dump the data (not structure) of the site_content table from phpMyAdmin with complete and extended inserts option, edit the resulting INSERT statement to remove the id field and corresponding values from the SQL it generates, then truncate (a.k.a. empty) the site_content table (modx_site_content if you used the default database table prefix when installing), and then execute the edited INSERT statement you dumped.
            • 14385
            • 31 Posts
            Ideal Mate, Your a legend cheers.

            Have a pint on me smiley

            Think i may hang around these boards a bit more, mod x is a great cms and it seems like a nice community.

            Jodz.

            p.s admin can close this thread now.