1 mel_t Jan 03, 2008 06:04
3 mel_t Jan 03, 2008 16:18
Thanks. I found it. But I have a MySQL problem. The import is impossible from CSV file. I think it's because in the last column (for example, param = a:1:{s:9:"link_type";s:12:"ownercontact";} ), the " and/or ; screw up the export.
Which method I can use? What I want it's all the date with id=4 and and duplicating, and modifying to id=5 and so on.
I try a query. I select correctly my data but I'm stuck up there. I'm not able to copy it.
Thx
Mel
4 afwas Jan 03, 2008 16:54
If you simply make a backup from the database, the file is in SQL language. It consists of statements to recreate the database. If you alter this file you shouldn' t have problems setting the database back. Simply use a plain text editor.
Note that this reply does not give an answer as to *what* you need to alter. I am afraid this is quit a tricky adventure since everything is related to everything. There is some interesting stuff, although deprecated, [url=http://doc.b2evolution.net/DB_schema/]here[/url].
Good luck
*edit*
typo
5 edb Jan 03, 2008 18:30
Afwas is spot-on here, and I'll add a tidbit I've learned the hard way: excel is really funny in how it handles the " thing. Sometimes it adds them, sometimes it removes them. I fought it for a LONG time when I had to use excel to write a javascript for use at work. My final answer was to document the exact steps one had to go through using notepad to undo the things excel did with the " character. Sloppy, but it worked.
So back on topic: using the "backup" feature of cpanel will give you a file named databasename.sql.gz which you can then rename to newdatabasename.sql.gz and then "backup restore" to a new database. Using the "export" feature in phpmyadmin will give you a file named databasename.sql which you then could use as a query in phpmyadmin to make a new database be exactly like the original database.
But it's crazy-mad stuff, meaning it'll drive you crazy and make you mad ;)
Therefore please be VERY careful with what you're doing in there. Backup everything with every method you can find, and be prepared to devote a lot of time and energy into figuring out how your exact host/server will behave.
6 mel_t Jan 12, 2008 23:10
Hi,
I did the operation 2 times because I needed to add a second one couple days after. So I post what I did in case someone need it. Maybe the method is quite "home-made-by-non-informatic-person" but it worked.
Even with some problems, I used CSV files as I can just increment very easily and copy lines. OpenOffice let you the possibility to select your character encoding, better for my french accentuated letters...
I did it with 2 empty blogs as template, any posts was there.
1st: I'm agree, make backup!!
2nd: export tables:
- _blogs, _bloggroup, _bloguser, _coll_settings, _categories : as CSV
_widget : as SQL[/list:u]
3rd: modifying
4th: re-import tables in database
For the first 4 tables, just duplicate what you want and change _blog_ID with the new ones. Quite easy, no problem.
Categories is more complicated. You have to modify the parent category correctly. To have unique url name, I use excel concatenation to create name category_1, category_7... For some reasons, one of the NULL is convert to 0. After import in database, I corrected it with a SQL query.
Widget is even more difficult. As the last rows contain ; it mess up in Excel. I use a SQL export and have to cut-copy everything. Dont forget to increment ID, it will no import into database if not.
Mel
7 mel_t Sep 04, 2009 05:39
More than 1 year and I still have to do same job. :-/ I want to move an existing blog to archive. Quite easy, just have to change name of it. But I need to create a new blog for the current year with all same settings. If someone know how to do it, I will be happy to heard it.
I could also move posts to a new blog but the problem is that it's quite long because it does'nt have a multi-selection to do so.
Thanks
Mel
It should be in the *_widget table, all of the widget data.