How to clone your ocPortal site
|
Posted
#72937
(In Topic #15285)
|
|
|---|---|
|
Community saint |
While the steps may seem a bit long-winded and fiddly, they should be straight forward enough. Please read the instruction completely first as you will need place your specific details in place of the following place holders: MAIN_DB_USERNAME MAIN_DB_NAME MAIN_DB_PASSWORD MAIN_SITE_DIR ←The director where you installed your main site CLONE_DB_USERNAME CLONE_DB_NAME CLONE_DB_PASSWORD CLONE_SITE_DIR ←The director where you installed your clone site CLONE_SITE_DIR_OLD STEP 1: Install a fresh copy of ocPortal. This will be your clone site. If you already have another ocPortal site installed that you want to re-use and make your clone site then ignore this step. STEP 2: Use the ocPortal upgrader tool (yoursite.com/upgrader.php) to flush the caches of your master site. There is no need to close the site. STEP 3: Backup the database of your main site by executing the following command in a shell (ssh) window, taking care to first replace the place holders with your specific details: Code
mysqldump -u MAIN_DB_USERNAME -p MAIN_DB_NAME --password=MAIN_DB_PASSWORD > main_db_backup.sql
STEP 4: Prepare the clone site's database to accept main site's database using the following ssh command (change place holders as required): Code
mysql --user=CLONE_DB_USERNAME --password=CLONE_DB_PASSWORD -BNe "show tables" CLONE_DB_NAME | tr '\n' ',' | sed -e 's/,$//' | awk '{print "SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS " $1 ";SET FOREIGN_KEY_CHECKS = 1;"}' | mysql --user=CLONE_DB_USERNAME --password=CLONE_DB_PASSWORD CLONE_DB_NAME
STEP 5: Replace the clone site's database with that of the main site using the following ssh command (change place holders as required): Code
mysql -u CLONE_DB_USERNAME -p CLONE_DB_NAME --password=CLONE_DB_PASSWORD < main_db_backup.sql
At this point you can delete main_db_backup.sql if you wish (by executing the rm main_db_backup.sql command in the ssh window). I sometimes don't if I'm going to be playing around with the tables of my clone site directly. So if I stuff something up I can just do steps 4 and 5 and I'm good to go. STEP 6: Now, to clone the rest of the site. In cPanel do the following: a) rename CLONE_SITE_DIR directory to CLONE_SITE_DIR_OLD. The main reason for this is to protect the .htaccess and info.php. If you are short on space then you can delete all files except those two.
b) navigate to MAIN_SITE_DIR folder and select all files and folders in that folder. c) select copy function and change destination path from "/public_html/mydomain.com/MAIN_SITE_DIR" to "/public_html/mydomain.com/CLONE_SITE_DIR" d) copy the following files from "CLONE_SITE_DIR_OLD" to "CLONE_SITE_DIR" to ensure that the cloned site will work correctly: .htaccess info.php e) delete CLONE_SITE_DIR_OLD directory Congratulations!!!, you should now have a working clone of your main site! A few things to note about the cloned site. 1) Its live, so anyone who has access to your main site has access to your clone site. If you don't want them to see the clone and the things under development you can either close the clone site (so only admins will be able to log in) or password protect the CLONE_SITE_DIR directory using cpanels Password Protect Directories feature. 2) Although the bulk of the clone site uses dynamically generated URLs which will automatically adjust to the new location and URLs, any URLs you have hard coded or that appear in content will still point to the main site. The classic examples of this are the URLs in spacer posts. This has never been an issue for me. 3) Because the clone looks identical to the main site you might want to consider making some small but obvious change to the look of the clone so that it is easily distinguishable from your main site. 4) User notifications will still be active, so if you reply to a members post (say for example you are testing that post reply still works), and they have email notifications turned on, they will receive the email notification. I think that's all. Enjoy!
Last edit: by temp1024
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
|
Posted
|
|
|
Community saint |
It looked a lot more appetising in my notes, but once I added the clarifications and the notes it become a bit of a mouth full. But remember Fletch, you did ask for it
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
Prehistorics Illustrated
http://prehistoricsillustrated.com Another ocPortal powered website & The Fascinating World of Dinosaurs & Prehistoric Creatures of all Kinds |
|
Posted
|
|
|
Community saint |
You betcha! And I am suitably grateful (adj: warmly or deeply appreciative) for the effort. I am certain to attempt to use it in the (very) near future, especially when I take a stab at producing 'themes' and ' templates'. It would be good to see how it would 'change' (read as 'screw-uo') a layout before deciding to offer it to other users. Once again,
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
|
Posted
|
|
|
Well-settled |
You out did yourself on this and I very much appreciate it. I'd give you a thousand points but I don't have that much to give Again thanx for putting the effort into this so that we may all benefit from it. I love this community |
|
Posted
|
|
|
Community saint |
All other zones are fine and I can navigate to many (maybe most) pages in the adminzone form the 404 page. Thanks for any clues. Bob PS - Just checked to SQL dump and the adminzone is included in the data for ocp6_zones. So it appears to maybe be a glitch during the import. I will empty the DB and try the import again.
Last edit: by BobS
|
|
Posted
|
|
|
Community saint |
Before re-importing the database, I decided to check the ocp6_zones table in the clone DB. Sure enough, the adminzone is there and is set to display in the zone menu but it doesn't. So what else would explain the Admin zone not being included in the zone menu and getting a 404 error when accessing the start page of the admin area? EDIT: I should clarify this: The Admin menu appears in the zone menu when an admin first logs in but clicking on it causes the 4040 and the removal from the zone menu. I can access any of the adminzone links from the 404 screen - it's just the adminzone start page which has gone missing. Any ideas? Bob
Last edit: by BobS
|
|
Posted
|
|
|
Community saint |
Bob |
|
Posted
|
|
|
Community saint |
EDIT: I think the problem might be with .htaccess . I forgot that I had updated it ages ago with the contents of recommended.htaccess, and I made the same changes to clone site, so a fresh/different install is not going to have the original .htaccess file any more. To fix this, copy .htaccess from main site to clone site, and check if there are any site specific paths that need changing. The reason my instructions say not to copy the .htaccess is because in my case there are two entries that have site specific paths The first is the ErrorDocument line, which ensures that 404 pages are displayed properly, and the second is a AuthUserFile line to ensure password protected directories work (I password protected my main site while it was in development). You should only need to do this the first time. Sorry about that BobS, I'll update the instructions accordingly.
Last edit: by temp1024
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
I'm guessing it was a fluke because I remember specifically choosing "Select all" in the cPanel file manager before choosing copy. I just panicked a bit because I was anxious to get this done so I could test the upgrade to 7.1.3 and work out any issues I would have in upgrading. Now onto upgrading the main site and then to finish those bits and bobs of coding. I want to get this site launched. Your instructions were great and I really appreciate you sharing them - they probably would have shaved off 10-15 minutes had I not had the glitch. Bob |
|
Posted
|
|
|
Fan in action |
temp104: Thanks for all o'that. It did convince me that here is a "no go zone" for me! Just realised the age of these posts - surely since those dark ages (webtime) all should have been made more like a Softaculous deal? HINT: Cheers! Himagain - BSOD (Black Screen Of Death) avoider, (Remembers lower-than-animals jokes on BBS's saying just add ( or hiding) this line del *.* …….. |
|
Posted
|
|
|
Community saint |
Can you seriously consider copying the instructions to the Community Docs so that there is a ready-reference for those that wish to use it? It occurs to me that it would also make a good reference point for the 'Book'!
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
|
Posted
|
|
|
Community saint |
Will Do. Mmmm. I'm not sure that it really belongs in the 'Book'.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
Disagree. It's almost a 'work of art' - but seriously - the flip-flop discussions as to whether there should be a 'demo' site to illustrate progress of a site build (the work in progress) appears to be leaning towards encouraging a user to build their own demo site. A 'cloned' site of one they've already built, on which to work along with the examples in the 'Book', might be more beneficial to the prospective user. But that's only my 2¢ worth …
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
|
Posted
|
|
|
Community saint |
The last thing you want to do though when introducing someone the ocp is to freak them out. The cloning instruction can freak people out by overwhelming them with its low level technical nature, and by giving the 'impression' that ocp may be fragile.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
I'll go away and chew on it some more …
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
|
Posted
|
|
|
Community saint |
Done: How to clone your ocPortal site - ocPortal.com
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
|
Posted
|
|
|
Community saint |
Looks like you got it working! Just make sure that you update info.php so that it uses the new domain, i.e: Code
$SITE_INFO['domain']='huberresidents.org';
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
1 guests and 0 members have just viewed this: None
Control functions:






Last edit: by 
