Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-12-08 19:39:13

jpowelso
Member
Registered: 2014-12-08
Posts: 11

restore a website with a new DB?

Hi all… see if I can fix this problem myself.

I moved to a new server and need to reinstall my textpattern blog. It was created back in 2006 and I no longer have a developer. I had backed up all of my files and folders containing the textpattern installation and had taken note of the SQL db name and user. I have since uploaded my backup of the textpattern installation to the new server and recreated the database and user. When I try to view the site, I get a message that something is really broken…

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/journey/public_html/v2/textpattern/lib/txplib_db.php on line 14

Warning: Cannot modify header information – headers already sent by (output started at /home/journey/public_html/v2/textpattern/lib/txplib_db.php:14) in /home/journey/public_html/v2/textpattern/lib/txplib_misc.php on line 1242

Warning: extract() expects parameter 1 to be array, boolean given in /home/journey/public_html/v2/textpattern/publish.php on line 56

Warning: Cannot modify header information – headers already sent by (output started at /home/journe/public_html/v2/textpattern/lib/txplib_db.php:14) in /home/journey/public_html/v2/textpattern/lib/txplib_misc.php on line 1242

Warning: Cannot modify header information – headers already sent by (output started at /home/journe/public_html/v2/textpattern/lib/txplib_db.php:14) in /home/journey/public_html/v2/textpattern/lib/txplib_misc.php on line 1308
Unknown section

Is this fixable… is it possible to get my textpattern site back up and running?

Last edited by jpowelso (2014-12-08 23:07:31)

Offline

#2 2014-12-08 21:58:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: restore a website with a new DB?

jpowelso wrote #286336:

It was created back in 2006

If you have restored your database and files on the new server, there’s a high likelihood that the version of PHP installed on the new server is significantly higher than that of the old one. Thus, your (old) copy of Textpattern will be trying to use features that have long since been removed from PHP. Hence the errors.

The cannot modify... messages are merely warnings because it displays previous errors, so we can ignore those. The main culprits are the other two.

The preferred way to proceed would be to upgrade Textpattern to the latest, or at least a later, version that is compatible with your version of PHP. Log into your admin side and visit Admin->Diagnostics to see the versions of things that are installed / running.

Upgrading may have an impact on the plugins that are installed. Many may no longer be necessary due to advances in the Textpattern core files. Others might not work well, or require upgrading. Others may not work at all and may need to be replaced with newer plugins that offer similar functionality, or your site may need to be altered to work around the functionality.

Short answer is: yes, it’s doable to restore everything. Long answer is it may take a few minutes or a few hours depending on how old your site is, how many plugins you have, and how your site templates are constructed.

First port of call is to take stock of what you have in your site. If you would like advice on any particular aspect of the procedure, feel free to post some pertinent parts of your diagnostic info. Your high diagnostics will include all installed plugins, which will enable those of us who have been around a while to advise on what options you have under a newer Textpattern version. Hope that helps.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2014-12-08 22:11:08

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: restore a website with a new DB?

Looks to me like u need to upgrade to the current version of Textpattern. Download the current version and look in the readme for instructions on how to upgrade. Double check you have a full back up before doing this.

Looks like your version of PHP is to new / to old. The upgrade will most likely fix.

Offline

#4 2014-12-08 22:12:15

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: restore a website with a new DB?

lol Stef, post clash.

Offline

#5 2014-12-08 23:05:49

jpowelso
Member
Registered: 2014-12-08
Posts: 11

Re: restore a website with a new DB?

Thanks for the advice!

Here is where I am at…

I have uploaded all of the files from the upgrade package per instructions. I was expecting a script, but the process was pretty simple – just replacing files.

After doing this I have two new errors to share.

When accessing the main site this is what error I receive:

general_error Textpattern Error: Table ‘journey_journey2.txp_prefs’ doesn’t exist on line 95
general_error Textpattern Error: Table ‘journey_journey2.txp_prefs’ doesn’t exist on line 95
general_error Textpattern Error: Table ‘journey_journey2.txp_prefs’ doesn’t exist on line 95
general_error Textpattern Error: Table ‘journey_journey2.txp_prefs’ doesn’t exist on line 95
general_error Textpattern Error: Table ‘journey_journey2.txp_prefs’ doesn’t exist on line 95
general_error Textpattern Error: Table ‘journey_journey2.txp_lang’ doesn’t exist on line 95
general_error Textpattern Error: Table ‘journey_journey2.txp_lang’ doesn’t exist on line 95
General error Textpattern Error: Table ‘journey_journey2.txp_section’ doesn’t exist on line 95
General error Textpattern Error: Table ‘journey_journey2.txp_page’ doesn’t exist on line 95
General error Textpattern Error: Table ‘journey_journey2.txp_page’ doesn’t exist on line 95
General error Textpattern Error: Table ‘journey_journey2.txp_page’ doesn’t exist on line 95

Now when attempting to access the admin side… another error:

internal_error “Table ‘journey_journey2.textpattern’ doesn’t exist”
in /home/journey/public_html/v2/textpattern/lib/txplib_db.php at line 95
internal_error “Cannot modify header information – headers already sent by (output started at /home/journey/public_html/v2/textpattern/lib/txplib_misc.php:709)”
in /home/journey/public_html/v2/textpattern/lib/txplib_misc.php at line 2241
internal_error “Cannot modify header information – headers already sent by (output started at /home/journey/public_html/v2/textpattern/lib/txplib_misc.php:709)”
in /home/journey/public_html/v2/textpattern/lib/txplib_misc.php at line 2312
DB-Connect was successful, but the textpattern-table was not found.

thoughts?

Offline

#6 2014-12-08 23:20:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: restore a website with a new DB?

jpowelso wrote #286344:

I was expecting a script, but the process was pretty simple – just replacing files.

Yep. The relevant upgrade scripts run when you first log into the admin side after replacing files.

internal_error “Table ‘journey_journey2.textpattern’ doesn’t exist” [snip]

Looks like Textpattern can’t find your tables. Presumably it can connect to the server fine or you’d get a “Database unavailable” error, and it can find config.php, which is good. So the next thing to check is:

  • Your table_prefix value in config.php matches your database table names on the server. If this is not the case, alter it accordingly. If you’re on a standard cpanel web host, the part before the dot is usually your account name. So my guess is it’ll either by journey or journey2, but not both. Judging from the error messages, I’m betting on the former.
  • Your database tables — with or without prefix — actually exist in MySQL :-) Check they have transferred OK by taking a peek with phpMyAdmin or equivalent, and have a poke around to ensure the data in the tables looks sane.

If all that checks out and you still have troubles, we’ll need to dig deeper.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2014-12-08 23:51:02

jpowelso
Member
Registered: 2014-12-08
Posts: 11

Re: restore a website with a new DB?

From config.php:

$txpcfg[‘table_prefix’] = ‘’;
$txpcfg[‘txpath’] = ‘/home/journey/public_html/v2/textpattern’;

Looking back to the original config.php, nothing was ever entered into the table prefix field. Also, I was not sure if I got txpath was correct or not. This DID change when moving servers.

I am working from a standard cpanel we host. The db’s I configure begin with journey_

database name for the textpattern site is journey_journey2

$txpcfg[‘db’] = ‘journey_journey2’;

I am not sure if I can view the DB tables in this mySQL setup. I was able to create a new DB for the migration to my new webhost (journey_journey2), create a new user,. and add that user to the DB. However I did look at phpMyAdmin, and for the specified DB, journey_journey2 —- it is completely empty.

Offline

#8 2014-12-08 23:59:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: restore a website with a new DB?

Hmmm, OK. I presumed (incorrectly) that the prefix was in use here, but that’s not the case. The database itself is called journey_journey2, so that’s fine.

I did look at phpMyAdmin, and for the specified DB, journey_journey2 —- it is completely empty.

That’ll be the problem then. No tables = no data = no site. When you mentioned in the first post that you recreated the database and user, did you load the data into the database from your backup? If not, now would be a good time to do that.

If you haven’t already done so, from the old server, use phpMyAdmin to Export the entire database to a file and download that to your computer. Then go to phpMyAdmin on the new server and Import the file you downloaded. That should get you another step closer.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#9 2014-12-09 00:04:39

jpowelso
Member
Registered: 2014-12-08
Posts: 11

Re: restore a website with a new DB?

I only have a backup of the files and folders from the original web host, no db files. I was hoping to recreate my site which has a custom theme. That is what we paid to have designed in 2006. I do not really care about the website content or if I lose any of the posts. Is it still possible to restore the site – maybe start with a clean slate?

Offline

#10 2014-12-09 00:24:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: restore a website with a new DB?

jpowelso wrote #286350:

I only have a backup of the files and folders from the original web host, no db files. I was hoping to recreate my site which has a custom theme.

“Themes” in Textpattern are a collection of Page templates, Forms, Stylesheets and Plugins (all stored in the database), sometimes with additional files such as images stored in the file system. Without a database backup, not only are the content of your posts gone, but also the site template. The only instance when this is not the case is if you had installed a plugin to allow you to store the database content on disk. But even then, you’d still need the other database tables such as txp_images, txp_files, txp_prefs, txp_users and so forth before you’d be able to use the site (these are, however, comparatively easy to create). If you have no tables, you wouldn’t even be able to log in to the admin side because user information is stored in the txp_users table.

It’s possible to start again with a clean slate and default template by running the setup routine at your-site.com/textpattern/setup, but you’d have to develop the theme again. If you choose this route, you will have to remove (or temporarily rename) config.php to allow setup to run successfully.

If you have no database backup — and no way of contacting the old host to obtain one — you may be able enlist the help of someone here to study the wayback machine version of your old site and recreate the theme, or just design a new theme once you get a database up and running. Past that, I’m fresh out of ideas, sorry.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#11 2014-12-09 04:07:55

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: restore a website with a new DB?

@jpowelso do you have i all the files etc that you saved a veinal Flat file version of your website? i.e. is there an index.php or index.html feel that yo can load into a browser and have it render the old site?

I have restored Textpattern sites in the past with just this information.

Also have you tried to grab such a file based site by using the wayback machine as bloke suggested?


…. texted postive

Offline

#12 2014-12-09 09:37:16

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: restore a website with a new DB?

If you have any way of exporting your database from your old site using phpmyadmin (or have even a past version of an export), that is by far the best option. That will give you a sql or .sql.gz file, that can be imported right into your new host’s database. Often it’s just a matter of bringing things up to date for a new version.

If you’re totally stuck, another alternative to the waybackmachine described above is to look in the google cache for your old website. You can only do that one page at a time, but you do at least get the page source. The recovermywebsite.com service will trawl the google (or bing) cache. It takes several hours and you receive a link to a zip file with what it can retrieve in lots of individual files (often snapshots of the same page from different dates). I used it a couple of months ago for the first time to resurrect a site where the host’s database had gone down and the host was unresponsive.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB