Saturday, 13 February 2016

Save and load user profiles in QGIS




  • Plugins installed and plugin repositories filled in

  • Toolbars enabled and disabled


  • Arrangement of Toolbars on the QGIS screen

  • SVG path for certain styles populated, in QGIS Menu: Options, System


"Did you find a way to make QGIS export the existing user profile to the new location specified above? – SAnderka Mar 3 '14 at 13:44" (How can I centralize QGIS connections for multiple QGIS installations)


QGIS 3.2.2-1 this is resolved


Leaving following and not removing just so it is clear that these methods, at least for me don't work.


Tried following, no success QGIS 2.2, QGIS 2.14-15


1. Can export default settings by using Open OSGeo4W


Paste:


    qgis --optionspath "X:\mynat\qgis" --configpath "X:\mynat\qgis"


(How can I centralize QGIS connections for multiple QGIS installations)


I am not sure how to import the settings, it may export your "adjusted" settings, rather than the default settings for QGIS.


2. Use settings, customisation, to export .ini settings ?


Can't import the settings using: settings, customization


3. Load QSS Plugin, create a new QGIS theme


Doesn't work for what I need to do. I don't remember it being possible to export and import themes. (http://plugins.qgis.org/plugins/LoadQSS/)


EDIT Replaced the contents of the .qgis2 file on another computer


Ran and copied the exported QGIS file from OSGeo4W script.


    qgis --optionspath "X:\mynat\qgis" --configpath "X:\mynat\qgis"


(How can I centralize QGIS connections for multiple QGIS installations)


Saved folder on new computer. On new computer went to to C:\Users\USERNAME.qgis2


Removed the contents of the .qgis2 folder


Contents:


C:\Users\USERNAME.qgis2\Cache
C:\Users\USERNAME.qgis2\gdal_pam
C:\Users\USERNAME.qgis2\processing
C:\Users\USERNAME.qgis2\project_templates
qgis (Data Base File)



Pasted contents of exported QGIS file


Open QGIS, same settings as before.


There is no .ini file to replace...


There is a possible way to import files, in QGIS 2.2 go to: Menu bar, Settings then: Options, General


See Heading: Project Files


There is: Open Project on launch, a selection box with New, Most Recent, Specific, and path location...


There is a Template Folder and Browse buttons Template folder path: C:\Users\USERNAME.qgis2\project_templates


There are also buttons called: * Set current project as default * Reset default


EDIT - How to force qgis to read Settings from somewhere else


On computer with the settings you want to use: Ran and copied the exported QGIS file from OSGeo4W script.



    qgis --optionspath "X:\mynat\qgis" --configpath "X:\mynat\qgis"

(How can I centralize QGIS connections for multiple QGIS installations)


On new computer, run OSGeo4W and used something like:


    qgis --optionspath "C:\Users\USERNAME\QGIS" --configpath 
"C:\Users\USERNAME\QGIS"

Copy and paste .ini file from computer with the settings you want into path on the "new computer"


    "C:\Users\USERNAME\QGIS"


Open QGIS, same settings as before.


Assuming I could just replace the .ini file?


I think I am exporting the "default" .ini file by mistake?


Further Test


I think the issue might be that I haven't installed the OS GEO4W correctly. Don't think that is the issue, as of: 28/11/2017


Though I have tried to install OS GE04W


"Note Don’t blindly do a full install of OSGeo4W.


Only install QGIS and maybe other components you like. Dependencies will be included automatically.


A full install pulls in components that require third party additions, which need to be installed manually. These components render the installation unusable without those additions."


Pasted from https://www.qgis.org/en/site/forusers/alldownloads.html



Test running OSGeo4W on Virtual Box, Windows 7 Enterprise


     start "QGIS" /B "%OSGEO4W_ROOT%"\bin\qgis-bin.exe --configpath "D:\cci93\config" %*

Start "QGIS" /B "%OSGEO4W_ROOT%"\bin\qgis-bin.exe --configpath "C:\Users\Dev\Documents\QGIS settings\QGIS\QGIS" %*

Popup errors


qgis-bin.exe - System Error The program can't start because qgis_core.dll is missing from your computer. Try reinstalling the program to fix this problem.


qgis-bin.exe - System Error The program can’t start because qgis_gui.dll is missing from your computer. Try reinstalling the program to fix this problem.


qgis-bin.exe - System Error The program can’t start because qgis_analysis.dll is missing from your computer. Try reinstalling the program to fix this problem.


Test 3-5



I have tried to export the "settings" for QGIS 2.14-15 long term release via OSGeo4W


The following code just dumps the "default" project settings into a folder, rather than my adjusted settings, adjusted project I have got locally. Where my adjusted project has more toolbars, rearranged toolbox, some installed plugins ect...


'qgis' is not recognized as an internal or external command, operable program or batch file.


So I have used qgis-ltr, qgis-ltr-bin instead.


This doesn't work:


    C:\>start qgis --optionspath "C:\Users\Name\Documents\Buffer Saves, To do\QGIS settings" --configpath "C:\Users\Name\Documents\Buffer Saves, To do\QGIS settings

or:


    C:\>qgis --optionspath "C:\Users\Name\Documents\Buffer Saves, To do\QGIS settings" --configpath "C:\Users\Name\Documents\Buffer Saves, To do\QGIS settings


This code does work*, but only exports the "default" settings:


Try 4


    start qgis-ltr --optionspath "C:\Users\Name\Documents\Buffer Saves, To do\QGIS settings" --configpath "C:\Users\Name\Documents\Buffer Saves, To do\QGIS settings

  Try 5


    qgis-ltr-bin --optionspath "C:\Users\Name\Documents\Buffer Saves, To do\QGIS settings" --configpath "C:\Users\Name\Documents\Buffer Saves, To do\QGIS settings

Further Information


"Here is a quick tip from a GIS.SE post that I answered the other day.


The topic was keeping the WMS settings in sync over different operating systems and machines. Normally QGIS will store it settings in the registry on Windows and in different locations on Linux and OS X. So then comes the question of how do you keep them in sync if you are using different machines.



Well the answer is simple. QGIS provides --optionspath and --configpath command line options in order to move the .qgis2 and settings files.


Using these two options, or just the one depending on what you need, will allow you to store the QGIS settings in a different location. Rather then storing the settings in the registry, or .config and .plist files, it will create a .ini file and save everything there.


All in all this means you can redirect your QGIS settings to a folder on dropbox and tell your QGIS installs to load the settings from a single place keeping everything in sync. When you change a setting it will sync with Dropbox and onto your other machines.


The simple way on Windows to add the --optionspath and --configpath options is to copy the shortcut to QGIS and append it to the end of the Target. 1 --optionspath "F:mydropboxqgis" --configpath "F:mydropboxqgis" Pasted from http://nathanw.net/2014/02/24/keeping-qgis-settings-in-sync-on-different-machines/


Existing Stackexchange Questions


How to change default path for ".qgis2" folder on Windows?


Where are QGIS application setting file(s) stored?


Transferring custom QGIS settings from one computer to another?


How can I centralize QGIS connections for multiple QGIS installations


What is OSGeo4W?




Answer



User Profile Management was added in QGIS v3.0.0. Some information may be found at the GitHub



User profile contains information about the user profile folders on the machine. In QGIS 3 all settings, plugins, etc were moved into a %APPDATA%/profiles folder for each platform. This allows for manage different user profiles per machine vs the single default one that was allowed in the past. A user profile is all settings and anything that used to be found in .qgis3 in the users home folder.



The management tools can be accessed from the Settings menu under User Profiles.


Functionally, this implementation acts in much the same way as the process described in this question and the comments. Loading a new user profile from the menu will open a new instance of QGIS using its associated profile folder.


Merely copying any profile folder to a target installation environment will achieve the migration of settings, but this does not address a "centralized" deployment.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...