1
Wonderfish1
Retrieving articles from database

Hi all,

I wasn't sure where to post this, because the problem is sort of in modules but mostly in the database.

I had some problems while updating the Articles module AMS and had to delete my old tables. In doing this, naturally I lost my old articles.

I do have old backups of my Xoops database that will have these articles in them. I need to know how to open the old database and extract the data from the old AMS tables.

I am not a database guy so something simple might be nice. I have tried opening the database in Access but no luck there.


Thanks in advance,
Tim

2
ghia
Re: Retrieving articles from database
  • 2010/6/19 7:12

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


How were the backups made?
What format do they have (try to open with a text editor)?
In principle you restore /backup (import / export) it with the same program eg phpMyAdmin.

3
Wonderfish1
Re: Retrieving articles from database

The backup was made using Xoops backup and restore.

Author
webmaster@nagl.ch
D.J. (xoops.org.cn)
Version - 3
Description
Backup and restore your Database

The backup is sql.

I was worried about opening it with phpMyAdmin in case it overwrote my current database - it is a backup and has the same name and attributes. Just being cautions.


Thanks,
Tim

4
Wonderfish1
Re: Retrieving articles from database

Could someone please help me out with a solution to this?

Thanks in advance,
Tim

5
Peekay
Re: Retrieving articles from database
  • 2010/6/21 22:24

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


You could hack the SQL file, but I would install a localhost version of MySQL and PHPMyAdmin. XAMPP is a popular solution which has a one-click installer. You should then be able to import the backed-up 'full site' SQL file into a blank database on your PC without risking your live site.

Basically, you create a new DB then select 'SQL' and 'Browse' to locate the SQL file and press 'Go'.

Having done that, you can select just the tables you want to restore to your live site (the AMS ones) and export those tables again as separate SQL files. There may be several to do.

You can then import each table separately into the matching AMS tables on your live DB using PHPMyAdmin.

If the AMS tables still exist on the live DB but are corrupt, press the 'empty' button in PHPMyAdmin. This clears out the table without deleting it. Then repeat the process for importing a SQL file as described above.

I don't have PHPMyAdmin on this PC and I can't remember the exact settings for exporting SQL, but if you Google 'PHPMyAdmin' there are plenty of tutorials that should be of help.

It may be a bit of work, but at least you have a backup
A thread is for life. Not just for Christmas.

6
madDan
Re: Retrieving articles from database
  • 2010/6/22 6:33

  • madDan

  • Not too shy to talk

  • Posts: 105

  • Since: 2010/1/6 1


mysqldumper is very handy as far as making backups and doing restores, it'll let you restore individual tables from a backup into your DB, Do take another backup of the current DB first though before starting any restoration, if you turn the backups auto deletion, you can take your time with as many backups as you desire.

If the backup is xxxxx.sql.gz you simply can copy your current backups into the softwares work directory

7
Wonderfish1
Re: Retrieving articles from database

Thanks very much for your help guys

I am too scared to try to restore the database tables to the live site, but if I could extract the text from the AMS module in the backup, I would author new articles in the new version, and just paste the old content. This would be the best and safest solution for me, I think.

I like the look of XAMPP to try to hack the content out of the backup using a local copy of phpmyadmin. I will let you know how it goes....


Thanks for your help,
Tim

8
Wonderfish1
Re: Retrieving articles from database

Hi guys,

I think the part I am trying to import is failing. I get this:

Resized Image


If I am reading this correctly, it is not importing the table:
xoops_ams_text(
which I think is the one I want.

Can I fix this?

I am sorry I am a dbtard. I really want the text of those articles back though.


Thanks again,
Tim

9
madDan
Re: Retrieving articles from database
  • 2010/6/22 12:28

  • madDan

  • Not too shy to talk

  • Posts: 105

  • Since: 2010/1/6 1


Is the db you are importing it into a copy of your current DB?

If you have removed the tables the table does not exist to restore to.

If you install ams to your site it will create the tables correctly and then you should be able import the old tables into that

A few ways to try this

Switch your site off to the public.

Backup your current DB

in xoops install AMS

then restore tables from backup of good AMS tables into DB

Or if a bit worried

Install AMS

copy DB

Rename copy

restore tables to copy

Note table names should be same ie same prefix etc

If you have changed your prefix the tables will be inserted alongside.


10
Wonderfish1
Re: Retrieving articles from database

For safety's sake I was trying to import into a blank database. I am using XAMPP and creating a new database with phpMy Admin - and then trying to import my backup into the blank database.

Login

Who's Online

307 user(s) are online (267 user(s) are browsing Support Forums)


Members: 0


Guests: 307


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits