backup/export/import

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
2/22/2009 10:18:36 AM
Nux
Gravatar
Total Posts 183

backup/export/import

Hi Joe,

I have setup a mojoportal to support multiple sites with the hostnames.
But I have questions about doing a backup for a customer. Since the setup has all sites in 1 db, I guess that when I backup the db
and I need to restore the db for one the customers, than all sites are restored. So if another customer has made changes to their site
after making the backup (which is usually a script that make a backup), he losses his changes which are not the purpose.

So how can this be made possible?
Would it be possible to have an export/import script as a backup? Or something else to make a backup / site, and not by setup.
Cause that feature of running more sites on one setup is great, but looses its benefits if this is not possible I guess.

Stef

2/22/2009 10:36:26 AM
Gravatar
Total Posts 18439

Re: backup/export/import

Hi Stef,

You are right this is a limitation. For this reason I do not personally host multiple sites for different customers in the same db. I only host multiple sites all by the same customer in a single installation.

Eventually I would like to build tools for import/export of site data but not sure when I will get to it and it will proably be an add on product when I do build it. My goal will be to implement this in a way where you can use it to change db platforms, ie export from MS SQL and import into another db or vice versa. So I will probably export to and import from xml. However restoring a site may be difficult to implement. It will be easier to export and import it as a new site instead of trying to to update or restore existing rows, that is a much more complicated problem.

When content versioning is in place it may mitigate this somewhat by being able to restore content previously deleted or changed. Restoring the db is a rather catastophic thing to be avoided. A backup can be used to move a site to a new server or if your customer wanted to move to self hosting. What I would do in that case is restore it to a new db, delete the other sites and then back it up again to give the customer a backup of only their own data.

Best,

Joe

2/22/2009 10:57:57 AM
Gravatar
Total Posts 18439

Re: backup/export/import

Another option to solve the immediate problem is to restore to a new installation and copy paste the lost content back to the original site. This assumes its just a few specific pieces of content that were lost. Its not an easy solution but in an emergency it can be done and conceivably you could charge your customer to do it.

Best,

Joe

2/22/2009 11:36:54 AM
Nux
Gravatar
Total Posts 183

Re: backup/export/import

Ok Joe, thanks for the info.

Like I told you, I would like to start implementing mojoportal for customers and
I'm now looking what I can do best in different situations. Thinking of programming an ex/import script myself, but this will be for later,
since I have to know more of the db structure. I guess that must be possible.
Perhaps I can make a sql version and someone else can make it for mySql, ...

Just a thought.

Stef

2/22/2009 11:51:47 AM
Gravatar
Total Posts 18439

Re: backup/export/import

Some of the challenges to solve at least for my long term vision of a tool like this will be:

  • how to keep it maintained as things are constantly being added/changed as the project evolves
  • how to make it flexible according to what features are installed, ie mojoportal core, mojoPortal.Features, WebStore, etc
  • how to make it easy to make new features that are also exportable

The stragey I have in mind is to use built in .NET ability to save DataTable/DataSets as xml with schema. The import side would pass in the DataTables or DataSet re-constituted from xml to each layer where db specific implementation would process it into the db.

I think I will need to keep some reference schema xml files generated on MS SQL in order to import to MS SQL from other dbs because the schema is different accross dbs due to difference in data types like MS SQL has a native Guid aka uniqueidentifer data type while the others we use char(36). So if the data was exported from another db as char(36) the importer would have to be smart enough to treat that as Guid.

Of course you don't have to think of all of that for your own solution.

Best,

Joe

2/22/2009 12:33:59 PM
Nux
Gravatar
Total Posts 183

Re: backup/export/import

Hmmm, I'm not a fan of Datatables/Datasets.
Have done some works on it and did not find it useful compared to the time to implement it.

I thought making a script that gets the data with the core api of mojoportal and writing down a sql script as plain text.
Nothing more. And every db layer should make it's own "sql". Something very easy to program if you work with the provider model.

Can you tell me why you don't work with the provider principle for the db layers?

Stef
 

2/23/2009 6:22:34 AM
Gravatar
Total Posts 18439

Re: backup/export/import

The provider model is useful for supporting different kinds of objects that support an interface and determining which kind to load at runtime. We don't need it for the database layer because which database to use is an install time decision not a runtime decision and I don't want the overhead of runtime checks for which provider to use for every data access method.

We use a static service facade pattern, using static methods guarantees the methods are threadsafe.

The solution of backing up data by creating insert sql statements can work if you are only concerned about backing up and restoring against 1 single database platform. The statements that would work for MS SQL will not work accross dbs. It makes sens for your goals but for my goals I need a common format to export/import from.

I don't use DataSets myself but in this case they offer a good convenience because they are easy to make, they have the schema in their meta data and they already provide an ability to export to xml. So I'm just saying for my goal it seems this would offer value. If I were only concerned about MS SQL I would not find it attractive because it would be easier to work directly with MS sql tools.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.