• How to use an SQL script to jump start your MODx site#

  • jamesehly Reply #1, 4 years, 4 months ago

    Reply
    I'm posting this in 'In Development' because the SQL script I'm posting is not for newbies, and it is in development. To automate the process of starting a new MODx site, I maintain a little database of the basic data I need for a new MODx site. This includes content, templates, chunks, snippets, template vars, users, roles, and categories. When I start a new MODx site, I export the data and import it using phpMyAdmin. This way, all of my basic templates, chunks, snippets, etc, are all set up and ready to use. Automating these basic processes saves me about 3 hours of work on each new site.

    I'm still in the process of refining the script/DB and it's built around the way I like things, but I've had thoughts of maybe turning this into a module (right, like I have the time for that!).

    I'd be interested to hear if anyone else does this or does it better, or in a different way.

    Attached to the post is a file with data only, and another one of data+structure. I use this with modx 0.9.5, and am not sure if it works with 0.9.6, but it might.

    I've written more about this on my blog at: http://www.devtrench.com/auto-site-start-modx-resource-install-script/

    Thanks,

    James


  • dev_cw Reply #2, 4 years, 4 months ago

    Reply
    Thats a good idea.


  • Jay Gilmore Reply #3, 4 years, 4 months ago

    Reply
    James,

    I looked at your sql and your blog post and while I don't think I wan't your styles in all my sites I think it makes immense sense for anyone who has certain design patterns to do as you did and do a MySQL Dump to use as a basis for speeding up production. It might be better if there were a faster way to do this but I think I may create a raw template with all my favourite stuff and such and use the dump on new sites.

    This may also warrant a Wiki Post to save time on development.

    All the best,

    Jay


  • jamesehly Reply #4, 4 years, 4 months ago

    Reply
    Quote from: smashingred at Sep 13, 2007, 09:36 PM
    I looked at your sql and your blog post and while I don't think I wan't your styles in all my sites


    That's actually the reason why this isn't a module yet. I figured that this particular SQL is too tailored to how I set up my sites, and I have trouble thinking about how to make it more generic. So it's probably just a good exercise in what you can do to help speed up your own development.

    Quote from: smashingred at Sep 13, 2007, 09:36 PM
    This may also warrant a Wiki Post to save time on development.


    That's a good idea, I just might do that
    Thanks for the comments!

    James




  • rthrash Reply #5, 4 years, 4 months ago

    Reply
    Maybe you might look at what ScottyD did with the installation wizard and collaborate with him on it.