Quantcast
Channel: Installing and upgrading help
Viewing all articles
Browse latest Browse all 46894

Re: Database Primary key problem

$
0
0
par Ken Task.  

First, make a backup of the existing DB, the data directory, and the code directory for the online server.  If something goes wrong, you can 'recover' fully by restoring those.

The easiest way at this point might be to backup courses from the local development machine and restore them to the server version.  However, if you want the whole enchilada ...

IF you've not done anything in the online server version that you'd like to keep (course wise), and IF your goal is to have the online server exactly like you developed it on the local version, then remove all tables - leaving the DB empty and void of tables.  This assumes the script installation of the DB set the DB for Innodb as the engine and utf8_general_ci or utf8_unicode as collation.

The sql dump from local you have has that information in it (or should).  That .sql file is a text file and can be opened with any text editor (NotePad or TextEdit will do - as they have search and replace ability).   Work with a copy of the .sql dump ... that way if edits mess up you can start again.

Do a search for ENGINE and see if there are references for ENGINE=InnoDB.  If the sql dump shows something else you'll need to change those references. 

Also check for URL references to http://localhost:8080/

The .sql dump probably has images/files linked using http://localhost:8080/... etc
and you'll have to use the Global Search and Replace cautiously to replace http://localhost:port#/ with http://newhost.somenet.net/ (include the trailing slash).  Do a find first to see what you are finding before replacing.

Once you've made those edits in the copy of the .sql dump, then import that edited .sql file into the empty DB of the online server with whatever tool you use.

Fingers cross (if you did the search and replace correctly), your online site should be accessible and one should be able to login with whatever users you had configured in local.  And, the URL's to images and files should work.

Once successful doing this, highly recommend using backup and restore from local to server and not replicating the process above every time (too prone to human error).  Also run a backup of what you have online before doing anything else and store it off line.

'spirit of sharing', Ken


Viewing all articles
Browse latest Browse all 46894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>