News: TinyPortal Release Schedule. Please read this update for More Info.

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

October 18, 2019, 08:19:41 PM

Login with username, password and session length

Recent

Members
  • Total Members: 3756
  • Latest: Ocean
Stats
  • Total Posts: 189090
  • Total Topics: 20764
  • Online Today: 73
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 43
Total: 43

Author Topic: Question: Database backups and Tiny Portal  (Read 3454 times)

0 Members and 1 Guest are viewing this topic.

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Question: Database backups and Tiny Portal
« on: August 25, 2005, 01:01:32 PM »
I have had a problem with one of my test installs of TP and thought I was OK because I had done both a file and database backup. For reasons I don't understand fully, OK I don't understand at all  :idiot2: I was unable to restore the database to recover from the problem. So I thought, I wonder if I can extract what I want from the sql file, no it doesn't seem to be in there.

So the $64,000 question is when you do a database backup,
A) Does it back up articles and menu settings etc?
B) If if does, where does it store them?
C) If it doesn't, what do we need to do to include all of the TP fields and tables in a database backup?

I have been using [unknown]'s create_backup.php and restore_backup.php utilities. SMF database prefix sgr_ , TP prefix (custom) sgrportal_ (I am running 4 test boards on the same database).

This is what I think is the case.

If you only have one board on its own in a database you are OK the backups of the whole database. If you do your backups with a tool that uses a table prefix, like create_backup.php, you will need to run it twice, once with your SMF_ prefix and again with your tportal_ prefix. To back the two up together you need for them to have the same prefix. The easiest way to achieve this ATM appears to be to run the TP install and then run a renaming utility to change the prefix on the TP tables, then manually change the TP files likewise.
« Last Edit: August 25, 2005, 03:20:32 PM by nokonium »

gelsbern

  • Guest
Re: Question: Database backups and Tiny Portal
« Reply #1 on: August 25, 2005, 04:44:17 PM »
My recommendation is to grab phpMyAdmin and use that for backing up and restoring your databases.  It is a nice GUI front end and has several other features that come in handy for database manipulation.  You can find phpMyAdmin here http://www.phpmyadmin.net/home_page/

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Re: Question: Database backups and Tiny Portal
« Reply #2 on: August 25, 2005, 11:48:05 PM »
I have that on the server control panel. My database files are circa 20Mb phpMyAdmin has a maximum restore file size of 2Mb or 8Mb depending on which version you have or is installed. I used to use that but [unknown]'s create and restore handles 20Mb without problem.

I can do regular backups to a folder on my site and then include the sql file in file backups.

What I was trying to highlight (clumsily) was the potential problem with database backups because of the different table prefixes used by SMF and TP by default. Even knowing this and using custom suffixes, I hadn't thought it through enough and made them start with exactly the same. I have with my 'Fiddlers Elbow' test site, I use elbow_ and elbow_tp_ this means that they are both backed up together. You must still allow TP to have its own set of tables otherwise there will be a problem with 'settings', you need ###_settings and ###_tportal_settings tables.

Bjørn

  • Guest
Re: Question: Database backups and Tiny Portal
« Reply #3 on: August 26, 2005, 02:47:19 AM »
If the baclup-utility support backing up ALL tables with the given prefix( smf_ for example) then you can do perhaps this: rename the 4 TP tables that belong to one smf..to the same as the smf install. Meaning:

smf_messages
smf_topics
..
..
elbow_settings -> smf_elbow_settings
elbow_variables -> smf_elbow_variables
elbow_articles -> smf_elbow_articles
elbow_blocks -> smf_elbow_blocks

So, just renaming the 4 tables that belong to TP for that particualr SMF installation and run the backup script. IF it will copy every smf_xxx table regardless, you should be fine. Now, to restore again, just use the script, and then either rename the 4 tables again(removing the smf_) or change the $tp_prefix to make the tables permantly use those names.

For your other SMF/TP install you could do the same.

If it doesn't support copying ALL smf_xx tables( skips those that are unfamilar) then the script will need to be changed for this. I might help out there then. But have a try at it first.

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Re: Question: Database backups and Tiny Portal
« Reply #4 on: August 26, 2005, 06:35:17 AM »
If the baclup-utility support backing up ALL tables with the given prefix( smf_ for example) ........

It does and that is what I have done with elbow_ and elbow_tp_

What I hadn't got for the one that I'm having to rebuild is the underscore between the sgr and portal. I didn't have the portal when I set up the d/b backup, had I used sgr_portal as the TP custom prefix all would have been OK. But I didn't think ahead when I custom named the TP prefix.

Thinking ahead to when you add extra modules, what are you going to do about the table prefixes for those? Could you extract the database prefix from Settings.php and add it to your prefixes?
« Last Edit: August 26, 2005, 06:49:01 AM by nokonium »

Bjørn

  • Guest
Re: Question: Database backups and Tiny Portal
« Reply #5 on: August 26, 2005, 07:14:20 AM »
At the moment I am staying with the 4 tables - even for extra modules. I use the same fields, but for different information. It makes for a quick table ( just the 5-6 fields) and keeping pure module settings in "settings" table - and the data in "variables" table. Blocks and articles tables are just for their meant purpose of course.

I might add another table or 2..but I don't want a whole bunch of them initially.

But..is the underscore important? or is it a undersore on SMF tables, but not on TP tables? i would think just renaming those and update $tp_prefix would fix that?

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Re: Question: Database backups and Tiny Portal
« Reply #6 on: August 26, 2005, 11:15:10 AM »
IIRC, when I update I need to mod the update file as well with the new prefix?

In my case I think that the underscore was important because I included it in one prefix and not in the other. I don't understand enough about SQL to know if an underscore is just another character or if it divides one part of the string from another.

Bjørn

  • Guest
Re: Question: Database backups and Tiny Portal
« Reply #7 on: August 27, 2005, 03:35:54 PM »
Its just a charachter. Its used to make reading the tables easier.

And yes..the current updater use tportal_ so you need to set that. But that will probably change with the next release.