How to make a clone of a website without contents
-
I need to create a clone of one of my website. It will be the same (modules, views, content types, template etc...) I've already done once by coping everything and then deleting the contents and the users. Is there the right way? I will need to do 3-4 copies of the website. Is there any module that can help me(a part from backup and migrate) to do these copies? Should I create an kind of "distribution" enabling modules and creating content type, similar to the master one, from the scratch and then export the database? If I do as I always did (clone and delete contents and users), how can I reset the content id? Thanks in advance
-
Answer:
I guess what your looking for is the features module http://drupal.org/project/features. When creating clones of websites, obviously all the code/themes/modules is easy to copy but the only way to get all your node types, fields, views etc... is in the database. Features exports all this information as a module as you can just copy this to a new site along with all your other modules, enable it, and voila all your views content types etc.. In the features you can list modules as dependencies so when enabling your feature all the contrib/core modules you need are enabled aswell (they will ofcourse need to exist on your new area). It intergrates fully with most the big contrib modules and from what I understand is exactly what your after. It can be daunting at first but dont worry its really very easy to use. The following video is for drupal 6 but the features interface is identical (as far as I remember) http://mustardseedmedia.com/podcast/episode43 There are other more complex ways to do what your after aswell using drush and creating build scripts, you can ever combine drush, build scripts and features. However I believe just normal features will do you fine.
Tyler Durden at Drupal Answers Visit the source
Other answers
This isn't going to answer your question fully but it might help a bit; some code to clear out all users and nodes in the system, then reset the auto-increments on the tables: $uids = db_query('SELECT uid FROM {users} WHERE uid > 1')->fetchCol(); user_delete_multiple($uids); db_query('ALTER TABLE {users} AUTO_INCREMENT = 2'); $nids = db_query('SELECT nid FROM {node}')->fetchCol(); node_delete_multiple($nids); db_query('ALTER TABLE {node} AUTO_INCREMENT = 1'); You'll need to use caution running the above as it's likely to take a long time and you'll probably exceed the max execution time. You could look at splitting it into batches though (probably worth another question if you decide to go down this route). The benefit of doing things this way is that all modules (at least those that behave themselves properly) will clear up any lingering field/custom data when the entities are deleted, so you won't have stagnant data in your db.
Clive
Couldn't you just clone the site in its entirety and then delete all the content through the content interface? If you're going to be doing this multiple times, it might be worth your while to http://drupal.org/project/install_profile_api/.
beth
After copying files and the DB, you can clean up the node and the users Table. Dont forget to keep the admin user in the table.
moertle
Related Q & A:
- How to make a fire in the wild, without burning the ground?Best solution by The Great Outdoors
- How to make a font using a png image?Best solution by Super User
- How can i make a banner for a website?
- How do I look at a website without the advertisements?Best solution by techwalla.com
- How to choose a font for a website?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.