Post by MrMcD » Sat Mar 30, 2013 8:38 pm

I have an opencart site and I have been running full FTP backups weekly.

I decided to run a mock restore on a development domain separate to my site.
I tried FTP'ing my most recent backup to the test domain. It failed. The FTP didn't fail, when all the files were transferred successfully, the browser had an error referencing index.php, line 19 when I tried opening the page. I have a vanilla copy of OC extracted, so I FTP'd the original index.php across but no joy.

In theory, should a full FTP work?

Newbie

Posts

Joined
Sat Mar 30, 2013 8:26 pm

Post by MrMcD » Sat Mar 30, 2013 10:40 pm

Sod's law, I've noticed that files such as config.php point to the domain and SQL db since writing this.
So in theory, my FTP backups should work on the live site but not the development site on a different domain right?
Are there a series of known files I can edit to force this site on a different domain + can I point it at the live SQL db?

Newbie

Posts

Joined
Sat Mar 30, 2013 8:26 pm

Post by cwswebdesign » Sat Mar 30, 2013 10:46 pm

MrMcD wrote:Sod's law, I've noticed that files such as config.php point to the domain and SQL db since writing this.
So in theory, my FTP backups should work on the live site but not the development site on a different domain right?
Are there a series of known files I can edit to force this site on a different domain + can I point it at the live SQL db?

There are the 2 config files (one in the root and one in the admin folder) that have to be edited to point the site to the right domain, folders, database, etc).

DL

This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.

Thanks!


User avatar
Active Member

Posts

Joined
Sun Dec 11, 2011 12:26 am
Location - USA

Post by butte » Sun Mar 31, 2013 5:46 am

The other half of the solution concerns the two databases themselves.

Pointing correctly in the two config.php files is required, of course, but on two different servers the database(s) will have different names. Their names ordinarily relate partly to your account username, in server-specific syntax. Manually look at the name/user/pass settings for both databases (hosting control panel for each server), so that the point will be unavoidably clear in the details that matter, then manually make the two config.php files for the second server match what the second server's database settings actually are. At that juncture via admin panel or the server control panel's phpMyAdmin you can respectively Restore or Import a whateveryounameit.sql obtained as a backup from the first server's OC admin panel or account control panel. Then both will have their own differently named databases with shared data. If at least one of the servers is dedicated, you can moreover have both stores actually share one database, but you may not want to "go there" now.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by MrMcD » Mon Apr 01, 2013 8:52 pm

Thanks Butte,

Glad you posted the DB procedure - I'm going round in circles with it though. My hosting package for my development site allows one DB only. I need to create a DB in the Cpanel before I can enter phpmyadmin.

My backup .sql file starts with the "CREATE" command. When I try to import it tells me access denied, can't create a new DB.

Can I hash out the "CREATE" command so it uses my current DB? Example:
-- Database: `db123456789`
--
-- Can I hash out the below to look like
-- CREATE DATABASE `OCDB` DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci;
USE db123456789;
-- Should I also hash out "USE"?
--
-- Table structure for table `address`
--
CREATE TABLE `address` (
`address_id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
etc etc etc

Newbie

Posts

Joined
Sat Mar 30, 2013 8:26 pm

Post by butte » Tue Apr 02, 2013 7:24 am

Your development host's limit of one database and procedure of establishing it before you go into phpMyAdmin are fairly commonplace. Establish it, notice the development server's database name, username, pass, etc. (as supra, 30th). Also notice those details for database in production box (ditto, 30th).

Now, (1) and (2) are readily doable, (a) is simpler than (b), and do not mix (a) with (b) under (1) or (2):

(1) Your production box database can be backed up two ways (and lingo may vary slightly among control panels and among phpMyAdmins). (a) In OC admin panel under Settings / Backup [/] Restore you can BACK IT UP TO your own machine. You'll get a whatevername.sql file. (b) In phpMyAdmin you can BACK IT UP OR EXPORT IT TO your own machine, uncompressed or compressed (take care not to double-compress it into .zip.zip). You'll get a whateverothername.sql or whateverothername.zip file (or both, go for it).

(2) Your development box database can be stuffed with the other database's innards two ways (and lingo may vary slightly among control panels and among phpMyAdmins). (a) In OC admin panel under Settings / Backup [/] Restore you can RESTORE IT FROM your own machine. You'll send up the same whatevername.sql file; the file content, not the file name is what you're restoring (even into a "blank" database). (b) In phpMyAdmin you can RESTORE OR IMPORT FROM your own machine the files made by phpMyAdmin. You'll send up the same whateverothername.sql or whateverothername.zip file; the file content, not the file name is what you're restoring or importing (even into a "blank" database).

(3) When you're stuck with one database you should still be able to assign each store, if several, its own database prefix. Be sure to impart a Restore or Import to the right one.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by elfstone » Wed Apr 03, 2013 4:51 pm

sorry for stealing your post, but i have similar problem. I made backup of all opencart files via FTP, and backup of database via opencart admin. I delete all tables in database. Is there any chance to restore this database. It is not working from phpmyadmin (missing tables)?

Newbie

Posts

Joined
Fri May 14, 2010 10:24 pm

Post by cwswebdesign » Thu Apr 04, 2013 3:30 am

elfstone wrote:sorry for stealing your post, but i have similar problem. I made backup of all opencart files via FTP, and backup of database via opencart admin. I delete all tables in database. Is there any chance to restore this database. It is not working from phpmyadmin (missing tables)?

You tried uploading your .sql file? If not, have you tried creating a brand new database that's empty and then uploading your .sql file via phpmyadmin? If the 2nd option works, you just have to change both of your config files to point to the new database.

DL

This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.

Thanks!


User avatar
Active Member

Posts

Joined
Sun Dec 11, 2011 12:26 am
Location - USA

Post by rph » Thu Apr 04, 2013 4:07 am

Unfortunately OpenCart's database backup method isn't very good. If you've dropped the entire database you're in some trouble. What you'll need to do is restore the database from a host backup (hopefully they've got one), empty, NOT drop, the tables, then use the backup you've got. This assumes the OpenCart database backup you have is newer than the host backup. If they're the same age you needn't bother with the OpenCart backup.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by butte » Thu Apr 04, 2013 10:59 am

If the database is in serious need of repair, follow his lead.

With a database still in good working order, it can be worth preliminarily backing it up BOTH ways in order to be sure WHETHER they will differ even then upon restoration. Variations among cPanel, Plesk, and others, and among plurals of them, will NOT always work identically relative to the OC approach.

It can also be worth, in both of those lights, setting up a separate database (give it a separate prefix, if you're stuck with having only one database), and trying it. You can use Maintenance to keep customers out while you insert stand-ins for the two config.php files to reflect the test, then revert afterward and release Maintenance.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by elfstone » Thu Apr 04, 2013 7:05 pm

Ok, i made it somehow. I installed fresh opencart 1.5.5.1 i uploaded all my modules and configure them as in old installation. Then i uploaded the database from admin. Then i uploaded my store files via FTP. It seams that database created in admin opencart is unusable in phpmyadmin though.

Newbie

Posts

Joined
Fri May 14, 2010 10:24 pm

Post by rph » Thu Apr 04, 2013 7:45 pm

It's usable, all the tables just need to be pre-existing which isn't going to be the case for many people. The Admin restore needs to have a method of creating tables if none exist added to it.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by butte » Fri Apr 05, 2013 9:38 am

You might want to take a look (hands-on; installed, along with mysql) at Oracle's Workbench. If you find yourself feeling comfortable with it, and with its resemblances to phpMyAdmin, it will afford fairly ready means of dealing with tables, etc.. There is a learning curve but in short order you'll know more than you ever wanted to know about them.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by overtonis » Mon May 13, 2013 2:44 pm

we are in same boat of wanting to back up the website. What we did was download the sql database via phpMyAdmin in Cpanel. We backed-up files via ftp. Are we saying I can't just upload files to 'test domain' and then point config file to 'test domain'. What happens if people sites crash...what are they going to do about it?

New member

Posts

Joined
Tue Apr 24, 2012 9:07 am

Post by dmsims » Mon May 13, 2013 4:22 pm

I have been testing backup and restore

Whilst FTPing the file part is OK I found it much quicker to create an archive with all the files and FTP that single file then restore it at the host

This assumes that your web host has some sort of file manager with archive functions in the control panel

Active Member

Posts

Joined
Sat Apr 13, 2013 6:05 pm

Post by overtonis » Tue May 14, 2013 12:24 pm

getting this error when I go to 'dummy' domain after uploading all files & database and adjusting config.php & admin/config/php to new domain/database/user.

Warning: require_once(/public_html/website/system/startup.php) [function.require-once]: failed to open stream: No such file or directory in /public_html/website/index.php on line 15

Fatal error: require_once() [function.require]: Failed opening required '/public_html/website/system/startup.php' (include_path='.:/usr/lib/php') in /public_html/website/index.php on line 15

New member

Posts

Joined
Tue Apr 24, 2012 9:07 am

Post by cwswebdesign » Tue May 14, 2013 6:42 pm

overtonis wrote:getting this error when I go to 'dummy' domain after uploading all files & database and adjusting config.php & admin/config/php to new domain/database/user.

Warning: require_once(/public_html/website/system/startup.php) [function.require-once]: failed to open stream: No such file or directory in /public_html/website/index.php on line 15

Fatal error: require_once() [function.require]: Failed opening required '/public_html/website/system/startup.php' (include_path='.:/usr/lib/php') in /public_html/website/index.php on line 15
Double check your config files. One of the paths to a directory is incorrect.

DL

This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.

Thanks!


User avatar
Active Member

Posts

Joined
Sun Dec 11, 2011 12:26 am
Location - USA

Post by carris92 » Sat Jun 29, 2013 12:25 pm

HI, i tried restoring my data but the error comes like this:

Notice: Error: Table 'ilovecup_layting.address' doesn't exist
Error No: 1146
TRUNCATE TABLE `address` in /home/ilovecup/public_html/system/database/mysql.php on line 50

What does it mean? And what should i do?

Newbie

Posts

Joined
Sat Jun 29, 2013 12:24 pm

Post by butte » Mon Jul 01, 2013 5:55 am

It appears that ilovecup is the account, _layting is the database, and the .address is the table it cannot find. Check the config.php pair for conformity of all DIR paths to the present server, and of all DB details to those you can find in your host control panel. Cheer up, it got past square one.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by webmix » Tue Jul 02, 2013 8:10 am

My way to backup/restore:
1. zip/backup all files
2. backup mysql-data to sql-file (adminer, phpmyadmin)
3. upload files (archive) to new server, unzip
4. clear 2 files (config.php, admin/config.php)
5. install opencart (default installation)
6. replace mysql-data (run sql-file in adminer or phpmyadmin)

WEBMIX
http://webmix.info
http://store.webmix.info
dmitriy.proshin@gmail.com


User avatar
New member

Posts

Joined
Tue Apr 05, 2011 2:03 am
Location - Ukraine, Dnepropetrovsk
Who is online

Users browsing this forum: No registered users and 11 guests