Using previous database?
3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 2, 2008 (RSS)
By KaboomJk - December 1, 2008
We recently lost all the data for our site on our server, including the cmsAdmin files. We were able to keep the database it was using, though. My question is if there is any way to re-set up CMS Builder to use the existing database. I already set it up to use the existing database, but it does not see any of the old data. I also tried to create an editor with the same table that I was using previously, but I get the message that the table name already exists and I should pick something else.
I'm trying to avoid having to start entirely from the beginning if possible. Is there anything I can do?
Thanks.
I'm trying to avoid having to start entirely from the beginning if possible. Is there anything I can do?
Thanks.
Re: [KaboomJk] Using previous database?
By Dave - December 1, 2008
Hi KaboomJk,
Note this is all undocumented and unplanned functionality, but you should be able to re-create your CMS Schema files and use the existing data this way:
CMS Builder won't show database tables that it doesn't have a schema file for, but it will show mysql fields it doesn't recognize if you already have a schema file.
So if you haven't already, backup your MySQL data.
Then, create a file /cmsAdmin/data/schema/sectionName.ini.php for each section with this content
(Another way to do this is to create your schemas as "sectionName2" then rename them after.
Then click on each section and set the field types and labels.
Feel free to email me FTP and CMS login details if you run into troubles and I can take a look (dave@interactivetools.com, email, don't post login details to the forum!).
Hope that helps!
Note this is all undocumented and unplanned functionality, but you should be able to re-create your CMS Schema files and use the existing data this way:
CMS Builder won't show database tables that it doesn't have a schema file for, but it will show mysql fields it doesn't recognize if you already have a schema file.
So if you haven't already, backup your MySQL data.
Then, create a file /cmsAdmin/data/schema/sectionName.ini.php for each section with this content
;<?php die('This is not a program file.'); exit; ?>
_detailPage = ""
_disableAdd = 0
_disableErase = 0
_filenameFields = ""
_hideRecordsFromDisabledAccounts = 0
_listPage = ""
_maxRecords = ""
_maxRecordsPerUser = ""
listPageFields = ""
listPageOrder = ""
listPageSearchFields = ""
menuHidden = 0
menuName = ""
menuOrder = 5
menuType = "" # set this to single, multi, or category and remove this comment.
[num]
order = 1
type = "none"
label = "Record Number"
isSystemField = 1
(Another way to do this is to create your schemas as "sectionName2" then rename them after.
Then click on each section and set the field types and labels.
Feel free to email me FTP and CMS login details if you run into troubles and I can take a look (dave@interactivetools.com, email, don't post login details to the forum!).
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com
Re: [Dave] Using previous database?
By KaboomJk - December 2, 2008
That did the trick. Thanks a lot!