We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4643
    • 34 Posts
    Hi Forum!

    I’m using MODx to build many sites with similar layout and it got very tedious to install MODx every time and add on all my items and settings. So I have experimented with a way to get all my own standard settings (all the ones in Tools - Configuration), users and all their settings (same manager users for all my sites), templates, TV’s modules, snippets, chunks etcetera. Got some questions here if anyone has any clues.

    First - I created a "standard" site with all my settings, chunks etc and a standard main index.html page, all different javascript files, CSS, xml etc. Much like the normal MODx installation, only with all my special add-ons. I also uploaded a few typical images (logo.jpg etc) to assets/images (to be modified later).

    Then, I used MODBAK to backup this site.

    From the backup zipfile, I took the database SQL query file (the db backup) and edited this to a more standard form with instructions in the beginning what to change for each new site later.

    Finally, to create a "standard" start-site, I use the normal MODx installation, then I simply drop all the tables from the database and re-create them using the SQL backup query (now modified for this particular site).

    This saves a lot of time but there are some minor quirks.

    There is a variable called site_id, it is read into the SQL database like this:
    INSERT INTO `modx-site-nnn_system_settings` VALUES (’site_id’,’nnnnnnnnnnnnn’);

    The ID appears to be a 13 digit hex number and it seems to differ between my sites. I haven’t found any reference to this in the settings anywhere in the manager interface so I have no clue what it does. The problem is of course that the number here will come from the simple standard-site I first created but I suppose it should really be a new unique number for each site.

    So - any clues here? Can I just omit it - maybe MODx will then create a site_id in that case, or should I set it to some random 13-digit hex number (maybe all zeroes?)? What does the site_id actually do? Maybe I could get the site_ID from the database just after the MODx install, before dropping the whole database - but I would like to make things as simple as possible so omitting this step would be nice.

    Currently, I have a few sites (still only on template stage, haven’t started to build on them yet) all with the same site_id, will this mess up something (they are hosted in the same place)?

    Does anyone think there is something else I might have overlooked in this approach, something that might mess things up later?