Re-populating db to new site

Permalink
I have backup a site but have to rebuild the site. How can

I re-populate the db with backed up data?

trixiemay
 
goldhat replied on at Permalink Best Answer Reply
If possible the first option is to upgrade the existing site. What version is the current site? You can rebuild in terms of changing the theme, changing packages, after you upgrade and that way you don't have the challenge of importing data from two different databases.

If for some reason that is not an option in your situation, you could try my StartingPoint Generator packagehttps://github.com/goldhatdev/starting_point_generator...

StartingPoint Generator creates a StartingPoint for installation from your existing site. If successful it will import the data from the old site when you install the new site. However, it's a work in progress and the import process for C5 is notably failure prone so I'd say it depends on the structure of your current site if it will work or not. StartingPoints are what the C5 installer uses during install, you can learn more here athttp://www.concrete5.org/documentation/how-tos/developers/concrete5...

What often happens in creating StartingPoints, is that the XML import file is imperfect and as a result there are errors. If you work on resolving those errors (which can be tedious) eventually you can get an import that works. Once you have a working import, then you're in great shape. Sometimes you'll have to sacrifice some content to make the import work, because certain data can cause problem, like certain blocks will trip up the importer functions. But if you can get 98% of your content migrated with a StartingPoint, then it's just a matter of manually adding/fixing the remainder.

I have another package in this area called Page Importerhttp://www.concrete5.org/marketplace/addons/page-importer/... it's in PRB right now. With that one you can export/import one page from the old site to the new site. It's one page at a time so a bit slow if you have a huge site, but still much faster than recreating all your content pages manually.

Then there are programmatic solutions to importing data. If you're up for programming a solution you have two major options. Either use the XML/CIF format for StartingPoints and the core importer which you can extend, or go the route of inserting data directly into the C5 database tables by using the various object API's. For instance with Page object you can make a new page with details like path, you can add attributes etc. But in terms of development time, this route would only make sense for a huge site because for a smaller site it may be faster to manually add the content to the site.

If you decide to go the route of StartingPoints let me know as I've focused a lot on that area of C5.
trixiemay replied on at Permalink Reply
trixiemay
Thats Awesome.

Essentially, I installed a site without the blog and now the client wants a blog. I am having a nightmare with a blog add-on I bought (due to poor instructions) so I figure why not use the built-in one.

But obviously that would involve a fresh start?