Duplicating a Firefox profile

Discussion of general topics about Mozilla Firefox
Post Reply
User avatar
Foxinabox
Posts: 166
Joined: November 10th, 2014, 8:29 pm

Duplicating a Firefox profile

Post by Foxinabox »

I often need to duplicate a Firefox profile for testing purposes on Win7 SP1 machines.

Is it safe to just copy the main profile folder and rename the copy?

Or will that mess things up with the original profile?

What is the best practice for this?
User avatar
Frank Lion
Posts: 21177
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Duplicating a Firefox profile

Post by Frank Lion »

Foxinabox wrote:I often need to duplicate a Firefox profile for testing purposes on Win7 SP1 machines.

Is it safe to just copy the main profile folder and rename the copy?

Or will that mess things up with the original profile?
Yep, that will really mess things up. Two ways to clone, easiest first -

#1. Create new profile and start Firefox with that profile.

#2. Exit Firefox and copy entire contents of original profile folder.

#3. Paste contents into new profile folder, overwriting all existing files and folders found there.

#4. You're done.


The second way is similar (I do it this way) and is only done to ensure total separation when working on different Firefox versions -

#a. Close Firefox. Rename Mozilla folder in AppsData to Mozilla44 or whatever.

#b. Start Firefox, count to 10 and exit Firefox.

#c. Find new profile in the newly created Mozilla folder and then it's #2 #3 and #4 as above.

To change profiles then rename both Mozilla folders. Firefox will always use the one named just Mozilla.
Last edited by Frank Lion on January 3rd, 2016, 7:45 am, edited 2 times in total.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
Foxinabox
Posts: 166
Joined: November 10th, 2014, 8:29 pm

Re: Duplicating a Firefox profile

Post by Foxinabox »

Frank Lion wrote:
Foxinabox wrote:I often need to duplicate a Firefox profile for testing purposes on Win7 SP1 machines.

Is it safe to just copy the main profile folder and rename the copy?

Or will that mess things up with the original profile?
Yep, that will really mess things up. Two ways to clone, easiest first -

#1. Create new profile and start Firefox with that profile.

#2. Exit Firefox and copy entire contents of original profile folder.

#3. Paste contents into new profile folder, overwriting all existing files.

#4. You're done.


The second way is similar (I do it this way) and is only done to ensure total separation when working on different Firefox versions -

#a. Close Firefox. Rename Mozilla folder in AppsData to Mozilla44 or whatever.

#b. Start Firefox, count to 10 and exit Firefox.

#c. Find new profile in the newly created Mozilla folder and then it's #1 #2 #3 and #4 as above.

To change profiles then rename both Mozilla folders. Firefox will always use the one named just Mozilla.
First, thanks. I had a hunch it would mess things up.

Second, I'm still chuckling over step #b. I imagined I was perhaps the only one who did anything like that. I always wait a few seconds after starting or exiting Firefox to let things "mellow". It seems to prevent problems.

In the 1-4 steps, outside of those steps causing profiles.ini to get updated, are there other differences to the method I mentioned?

As an alternative (just trying to learn), instead of steps 1-4, would it be possible to just use the -Profile command line argument to specify a directory that is a copy of a profile?

IOW:
i. copy a profile into folder "franksandbeans"
ii. run firefox.exe -Profile "franksandbeans"

Or would that have the same problems as what I originally mentioned?

The steps a-c you mentioned sound really clean. For step c, did you mean "...and then it's #2 #3 and #4 as above" instead of "...and then it's #1 #2 #3 and #4 as above"?

BTW, in all these examples (except the "franksandbeans" example above), won't Firefox use the "Cache2", "OfflineCache", "safebrowsing", "startupCache", et al. folders of the old profile since the techniques don't involve manipulating the other half of the profile (which on Win7, Firefox places within the Local directory by default)? Will this cause some issues?
User avatar
Frank Lion
Posts: 21177
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Duplicating a Firefox profile

Post by Frank Lion »

Foxinabox wrote:The steps a-c you mentioned sound really clean. For step c, did you mean "...and then it's #2 #3 and #4
Yep, writing too fast as usual. Now edited.

I'll look at the other questions another time, got to dash off now. Hope that helped.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
mod_wastrel
Posts: 354
Joined: July 6th, 2006, 1:34 pm
Location: VA, US

Re: Duplicating a Firefox profile

Post by mod_wastrel »

Foxinabox wrote:I often need to duplicate a Firefox profile for testing purposes on Win7 SP1 machines.

Is it safe to just copy the main profile folder and rename the copy?

Or will that mess things up with the original profile?

What is the best practice for this?
As long as Firefox isn't running, you can copy a profile elsewhere as much as you want to. Simply doing that won't mess up anything with Firefox itself or with the profiles; some extensions that don't specify relative file locations for something in the profile folder might have a problem though (but everything native to Firefox uses relative paths). The simplest way to do testing, though, is to use Firefox Portable. The only real difference between portable and locally-installed is that portable is (1) "installed" to a custom location and (2) the profile is located in a "sibling" folder--portable always uses the -profile flag when starting (Firefox profile manager is never used). I've been copying profiles around for more than a decade--thousands of times with no problems at all.
;) mozillaZine is not Mozilla; just as Godzilla is not God. Neither is Mozilla God... they just think they are (what's that about:mozilla?).
Hey, Mozilla... are you sure you wish to do this? (bug 1121291)
User avatar
Frank Lion
Posts: 21177
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Duplicating a Firefox profile

Post by Frank Lion »

Foxinabox wrote:As an alternative (just trying to learn), instead of steps 1-4, would it be possible to just use the -Profile command line argument to specify a directory that is a copy of a profile?
Many things are possible, those that are inadvisable I just don't mention. Plus, I always write using the simplest method possible and, wherever possible, using techniques that people already know (Copy/Paste/Rename, etc)

Like I did here, for example - http://kb.mozillazine.org/Creating_a_ne ... on_Windows The idea is always to give effective and simple advice, not to write encyclopedia-type articles that only confuse people.

Certainly what is possible is for people to have their entire 'My Documents' deleted because they didn't understand what they were doing with directory folders or realise the bugs in Firefox -
https://bugzilla.mozilla.org/show_bug.cgi?id=302087
won't Firefox use the "Cache2", "OfflineCache", "safebrowsing", "startupCache", et al. folders of the old profile
A new Local profile will be auto-created using the new profile name.


mod_wastrel wrote:As long as Firefox isn't running, you can copy a profile elsewhere as much as you want to. Sim
How about you spell out where 'elsewhere' is and what steps to take after copying? Otherwise your post is useless to people.

Btw - good luck finding a portable version of Firefox 46.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
therube
Posts: 21714
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Duplicating a Firefox profile

Post by therube »

Foxinabox wrote:As an alternative (just trying to learn), instead of steps 1-4, would it be possible to just use the -Profile command line argument to specify a directory that is a copy of a profile?
Yes.
And as you are learning, I would think that to be something you'd want to explore. (Safely :-).)
elsewhere
That just about sums it up. Just about any place you can copy to.

Now that certainly does not meet these "rules":
Frank wrote:Many things are possible, those that are inadvisable I just don't mention. Plus, I always write using the simplest method possible
And you certainly do need to know more the simply "elsewhere".
And you certainly need to use some common sense.
And you then need to know how you go about accessing the "elsewhere" Profile, the -Profile switch would be one way.
And on & on & on.

And if ones abilities are not sufficient to do "elsewhere", the method Frank pointed out works just as well.
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
mod_wastrel
Posts: 354
Joined: July 6th, 2006, 1:34 pm
Location: VA, US

Re: Duplicating a Firefox profile

Post by mod_wastrel »

The only "problems" I've ever seen related to copying profiles involved not dealing with the profile manager properly; it's not particularly complex, but some users still manage to muck it up. Well, as I said, I don't use it--except for the occasional testing; which, as far as I'm concerned, is the proper way to deal with it. Using the -profile flag couldn't be simpler, and copying... any file manager can do that.
;) mozillaZine is not Mozilla; just as Godzilla is not God. Neither is Mozilla God... they just think they are (what's that about:mozilla?).
Hey, Mozilla... are you sure you wish to do this? (bug 1121291)
Post Reply