<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://blog.gramps-project.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Diggernet</id>
	<title>Gramps - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://blog.gramps-project.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Diggernet"/>
	<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php/Special:Contributions/Diggernet"/>
	<updated>2026-07-06T21:12:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.3</generator>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Talk:GEPS_027:_Gender_as_an_Entry_Field&amp;diff=38658</id>
		<title>Talk:GEPS 027: Gender as an Entry Field</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Talk:GEPS_027:_Gender_as_an_Entry_Field&amp;diff=38658"/>
		<updated>2012-08-21T21:12:14Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*~*~Please use this space to discuss, but I'd appreciate if you thought about how your language may affect others before you post, this stuff is sticky and so personal~*~*&lt;br /&gt;
&lt;br /&gt;
* Looks great! Feel free to put a patch on the Bugtrack ticket. (Easiest way to make a patch: &amp;quot;cd gramps/trunk; svn diff &amp;gt; my-name.patch&amp;quot; and then upload. --[[User:Dsblank|Dsblank]] 15:25, 17 May 2012 (MDT)&lt;br /&gt;
&lt;br /&gt;
* My concern here is that this idea conflates two separate pieces of information:  Sex (biological context: XX or XY), and sexual identity (social context: how they view themselves sexually).  I have no objection to adding a field for sexual identity (or orientation), which would necessarily be an entry field, but do not agree with having it replace the existing field for biological sex.  To do so would leave it impossible to capture both the biological and social aspects of a person, just as it is currently.  In short, it would be just as wrong, but in the other direction.  :)&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Talk:GEPS_013:_Gramps_Webapp&amp;diff=18591</id>
		<title>Talk:GEPS 013: Gramps Webapp</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Talk:GEPS_013:_Gramps_Webapp&amp;diff=18591"/>
		<updated>2009-08-03T00:04:11Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: New page: =Security= Security is a big enough issue for a server that it probably ought to be its own section rather than just a bullet point under &amp;quot;Discussion&amp;quot;.  Obviously there is a LOT of other w...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Security=&lt;br /&gt;
Security is a big enough issue for a server that it probably ought to be its own section rather than just a bullet point under &amp;quot;Discussion&amp;quot;.  Obviously there is a LOT of other work to be done still on this great concept.  But I wanted to toss out some thoughts on what a GRAMPS Server security model may (or may not) support, since having these ideas in mind might affect other design decisions along the way.  It's always good to have security in mind while designing a server.  And yes, some of what I describe here are my favorite details of the PhpGedView security model.  It is excellent for sharing data with family members, but GRAMPS is far better for maintaining the data.  Having a GRAMPS Server someday is a wonderful dream that would end the need to convert my data in order to share it!&lt;br /&gt;
&lt;br /&gt;
* User accounts.  A server really must support multiple users with different credentials and access permissions, even if one chooses not to configure it for collaboration (only one user with write permission).  This is the primary reason I dropped GeneWeb for PhpGedView some time ago.&lt;br /&gt;
* Optional anonymous user.  Some databases would be appropriate to drive a fully-public website.  Others would not.  If enabled, the anonymous user would have the same configurable access permissions as any other user (probably configured very restrictively).&lt;br /&gt;
* Ability to attach a given user account to a specific person in the database.&lt;br /&gt;
* Ability to choose whether a given user can see info about living people.&lt;br /&gt;
* Ability to control how far from their &amp;quot;home&amp;quot; Person a given user can see info about living people.&lt;br /&gt;
* Ability to choose whether a given user can edit.&lt;br /&gt;
* Ability to control how far from their &amp;quot;home&amp;quot; Person a given user can edit.&lt;br /&gt;
* Ability to make a given user an admin, so they can access and edit server settings and user accounts (perhaps separate settings for server and user admin?).&lt;br /&gt;
* Revision control.  Like this wiki, the ability to retrieve the history of any given database object, and see what changes were made, when, and by whom.&lt;br /&gt;
&lt;br /&gt;
There are surely plenty of other possible capabilities, but these are what come to mind right now as being most important for preserving the privacy and integrity of the data.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5948</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5948"/>
		<updated>2008-04-06T02:12:42Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: delete working copy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5905</id>
		<title>Run Gramps from a portable drive</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5905"/>
		<updated>2008-04-03T06:22:20Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* How it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How do I...]]&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
If you keep your media files on the removable drive with your GRAMPS data (what use are they otherwise?), be sure to make them use relative paths.  Doing so will allow the paths to continue working as you move between computers (with adjustments to the media base path), while absolute paths are almost certain to break.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to re-edit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=&amp;quot;${0%/*}&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; $*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
Shell scripts use &amp;lt;code&amp;gt;$0&amp;lt;/code&amp;gt; (or alternately &amp;lt;code&amp;gt;${0}&amp;lt;/code&amp;gt;) to refer to the path and name of the script itself.  There are also operators that let you modify that value.  The &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; character is used to remove part of the end of the string, and what follows that character tells what to remove, with &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; being a wildcard.  So &amp;lt;code&amp;gt;${0%/*}&amp;lt;/code&amp;gt; says to remove the last &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; and everything after it from the path and name of the script, leaving the directory where the script is located.&lt;br /&gt;
&lt;br /&gt;
The script uses that to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then runs GRAMPS.  Setting &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; on the same line as the GRAMPS command makes the value available to GRAMPS.  The other way of making the value available, with the &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command, would cause the new value to carry over into the environment of the shell that ran this script after GRAMPS has run.  That could cause problems running GRAMPS normally later, so we do it this way instead.&lt;br /&gt;
&lt;br /&gt;
==Software Versions==&lt;br /&gt;
While these instructions help you easily move your GRAMPS data between computers, '''''no''''' testing has been done to explore compatibility between different software versions.  It is recommended that you only move your data between computers that share the same GRAMPS, Python, database and operating system versions.  The more those versions differ, the greater risk of database corruption and data loss.  You are encouraged to export your database to GRAMPS XML for safety when moving the data between computers with differing (or unknown) software versions.  Do this on your known safe computer before moving to an unknown computer, and again when you have finished with GRAMPS on the new computer before moving back to your regular computer.&lt;br /&gt;
&lt;br /&gt;
===GRAMPS===&lt;br /&gt;
GRAMPS 2.x and 3.x are ''NOT'' compatible with each other.  The instructions and scripts here are intended for use with GRAMPS 3.0, and it is highly recommended that you ensure the '''same''' version of GRAMPS is installed on each computer.  A similar technique to that described here could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]].&lt;br /&gt;
&lt;br /&gt;
===Python and Database===&lt;br /&gt;
GRAMPS stores its data with the BSDDB engine bundled with Python.  While the Python and BSDDB developers do make an effort to keep new versions of their software backward compatible, the risk of incompatibility increases with the distance between versions.  To determine the versions of Python and BSDDB on a computer, enter the following commands in a terminal window (the input prompts are &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; python&lt;br /&gt;
Python 2.5.1 (r251:54863, Mar  7 2008, 03:41:45)&lt;br /&gt;
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2&lt;br /&gt;
Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
Moving your GRAMPS data between computers with different operating systems seems possible, but is '''''NOT''''' officially supported.  '''Do so at your own risk!'''&lt;br /&gt;
&lt;br /&gt;
{{man warn| Backup, backup, backup! |If you do try to move your data between operating systems like this, '''''ALWAYS''''' export your database to GRAMPS XML before changing operating system.  If you don't, you may live to regret it.}}&lt;br /&gt;
&lt;br /&gt;
You can experiment with this by simply putting both the above &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; scripts in the same directory on your removable drive.  If you then run &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; on Windows and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; on Linux, GRAMPS will use the same configuration and data files on both operating systems.&lt;br /&gt;
&lt;br /&gt;
Since this behavior is neither encouraged nor tested, there are any number of possible problems you may encounter.  Here are some of the known problems you will see:&lt;br /&gt;
* When first opening a database after changing operating system, you may get an error that says &amp;quot;Low level database corruption detected&amp;quot; and instructs you to use the Repair button to fix the problem.  This seems to work, but ''it is not known for sure whether any data loss may occur in the process''.&lt;br /&gt;
* You will need to update the media base path in Preferences every time you switch operating system.&lt;br /&gt;
* If your media files are referenced with any directory information (either absolute paths or relative paths with subdirectories), each path will only work on the operating system on which it was entered.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5904</id>
		<title>Run Gramps from a portable drive</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5904"/>
		<updated>2008-04-03T06:03:38Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How do I...]]&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
If you keep your media files on the removable drive with your GRAMPS data (what use are they otherwise?), be sure to make them use relative paths.  Doing so will allow the paths to continue working as you move between computers (with adjustments to the media base path), while absolute paths are almost certain to break.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to re-edit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=&amp;quot;${0%/*}&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; $*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
==Software Versions==&lt;br /&gt;
While these instructions help you easily move your GRAMPS data between computers, '''''no''''' testing has been done to explore compatibility between different software versions.  It is recommended that you only move your data between computers that share the same GRAMPS, Python, database and operating system versions.  The more those versions differ, the greater risk of database corruption and data loss.  You are encouraged to export your database to GRAMPS XML for safety when moving the data between computers with differing (or unknown) software versions.  Do this on your known safe computer before moving to an unknown computer, and again when you have finished with GRAMPS on the new computer before moving back to your regular computer.&lt;br /&gt;
&lt;br /&gt;
===GRAMPS===&lt;br /&gt;
GRAMPS 2.x and 3.x are ''NOT'' compatible with each other.  The instructions and scripts here are intended for use with GRAMPS 3.0, and it is highly recommended that you ensure the '''same''' version of GRAMPS is installed on each computer.  A similar technique to that described here could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]].&lt;br /&gt;
&lt;br /&gt;
===Python and Database===&lt;br /&gt;
GRAMPS stores its data with the BSDDB engine bundled with Python.  While the Python and BSDDB developers do make an effort to keep new versions of their software backward compatible, the risk of incompatibility increases with the distance between versions.  To determine the versions of Python and BSDDB on a computer, enter the following commands in a terminal window (the input prompts are &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; python&lt;br /&gt;
Python 2.5.1 (r251:54863, Mar  7 2008, 03:41:45)&lt;br /&gt;
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2&lt;br /&gt;
Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
Moving your GRAMPS data between computers with different operating systems seems possible, but is '''''NOT''''' officially supported.  '''Do so at your own risk!'''&lt;br /&gt;
&lt;br /&gt;
{{man warn| Backup, backup, backup! |If you do try to move your data between operating systems like this, '''''ALWAYS''''' export your database to GRAMPS XML before changing operating system.  If you don't, you may live to regret it.}}&lt;br /&gt;
&lt;br /&gt;
You can experiment with this by simply putting both the above &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; scripts in the same directory on your removable drive.  If you then run &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; on Windows and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; on Linux, GRAMPS will use the same configuration and data files on both operating systems.&lt;br /&gt;
&lt;br /&gt;
Since this behavior is neither encouraged nor tested, there are any number of possible problems you may encounter.  Here are some of the known problems you will see:&lt;br /&gt;
* When first opening a database after changing operating system, you may get an error that says &amp;quot;Low level database corruption detected&amp;quot; and instructs you to use the Repair button to fix the problem.  This seems to work, but ''it is not known for sure whether any data loss may occur in the process''.&lt;br /&gt;
* You will need to update the media base path in Preferences every time you switch operating system.&lt;br /&gt;
* If your media files are referenced with any directory information (either absolute paths or relative paths with subdirectories), each path will only work on the operating system on which it was entered.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5903</id>
		<title>Run Gramps from a portable drive</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5903"/>
		<updated>2008-04-03T06:02:59Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How do I...]]&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
If you keep your media files on the removable drive with your GRAMPS data (what use are they otherwise?), be sure to make them use relative paths.  Doing so will allow the paths to continue working as you move between computers (with adjustments to the media base path), while absolute paths are almost certain to break.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to re-edit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=&amp;quot;${0%/*}&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; $*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
==Software Versions==&lt;br /&gt;
While these instructions help you easily move your GRAMPS data between computers, '''''no''''' testing has been done to explore compatibility between different software versions.  It is recommended that you only move your data between computers that share the same GRAMPS, Python, database and operating system versions.  The more those versions differ, the greater risk of database corruption and data loss.  You are encouraged to export your database to GRAMPS XML for safety when moving the data between computers with differing (or unknown) software versions.  Do this on your known safe computer before moving to an unknown computer, and again when you have finished with GRAMPS on the new computer before moving back to your regular computer.&lt;br /&gt;
&lt;br /&gt;
===GRAMPS===&lt;br /&gt;
GRAMPS 2.x and 3.x are ''NOT'' compatible with each other.  The instructions and scripts here are intended for use with GRAMPS 3.0, and it is highly recommended that you ensure the '''same''' version of GRAMPS is installed on each computer.  A similar technique to that described here could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]].&lt;br /&gt;
&lt;br /&gt;
===Python and Database===&lt;br /&gt;
GRAMPS stores its data with the BSDDB engine bundled with Python.  While the Python and BSDDB developers do make an effort to keep new versions of their software backward compatible, the risk of incompatibility increases with the distance between versions.  To determine the versions of Python and BSDDB on a computer, enter the following commands in a terminal window (the input prompts are &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; python&lt;br /&gt;
Python 2.5.1 (r251:54863, Mar  7 2008, 03:41:45)&lt;br /&gt;
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2&lt;br /&gt;
Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
Moving your GRAMPS data between computers with different operating systems seems possible, but is '''''NOT''''' officially supported.  '''Do so at your own risk!'''&lt;br /&gt;
&lt;br /&gt;
{{man warn| Backup, backup, backup! |If you do try to move your data between operating systems like this, '''''ALWAYS''''' export your database to GRAMPS XML before changing operating system.  If you don't, you may live to regret it.}}&lt;br /&gt;
&lt;br /&gt;
You can experiment with this by simply putting both the above &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; scripts in the same directory on your removable drive.  If you then run &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; on Windows and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; on Linux, GRAMPS will use the same configuration and data files on both operating systems.&lt;br /&gt;
&lt;br /&gt;
Since this behavior is neither encouraged nor tested, there are any number of possible problems you may encounter.  Here are some of the known problems you will see:&lt;br /&gt;
* When first opening a database after changing operating system, you may get an error that says &amp;quot;Low level database corruption detected&amp;quot; and instructs you to use the Repair button to fix the problem.  This seems to work, but ''it is not known for sure whether any data loss may occur in the process''.&lt;br /&gt;
* You will need to update the media base path in Preferences every time you switch operating system.&lt;br /&gt;
* If your media files are referenced with any directory information (either absolute paths or relative paths with subdirectories), each path will only work on the operating system on which it was entered.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5733</id>
		<title>Run Gramps from a portable drive</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5733"/>
		<updated>2008-03-27T05:46:01Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How do I...]]&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
If you keep your media files on the removable drive with your GRAMPS data (what use are they otherwise?), be sure to make them use relative paths.  Doing so will allow the paths to continue working as you move between computers (with adjustments to the media base path), while absolute paths are almost certain to break.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to re-edit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
==Software Versions==&lt;br /&gt;
While these instructions help you easily move your GRAMPS data between computers, '''''no''''' testing has been done to explore compatibility between different software versions.  It is recommended that you only move your data between computers that share the same GRAMPS, Python, database and operating system versions.  The more those versions differ, the greater risk of database corruption and data loss.  You are encouraged to export your database to GRAMPS XML for safety when moving the data between computers with differing (or unknown) software versions.  Do this on your known safe computer before moving to an unknown computer, and again when you have finished with GRAMPS on the new computer before moving back to your regular computer.&lt;br /&gt;
&lt;br /&gt;
===GRAMPS===&lt;br /&gt;
GRAMPS 2.x and 3.x are ''NOT'' compatible with each other.  The instructions and scripts here are intended for use with GRAMPS 3.0, and it is highly recommended that you ensure the '''same''' version of GRAMPS is installed on each computer.  A similar technique to that described here could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]].&lt;br /&gt;
&lt;br /&gt;
===Python and Database===&lt;br /&gt;
GRAMPS stores its data with the BSDDB engine bundled with Python.  While the Python and BSDDB developers do make an effort to keep new versions of their software backward compatible, the risk of incompatibility increases with the distance between versions.  To determine the versions of Python and BSDDB on a computer, enter the following commands in a terminal window (the input prompts are &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; python&lt;br /&gt;
Python 2.5.1 (r251:54863, Mar  7 2008, 03:41:45)&lt;br /&gt;
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2&lt;br /&gt;
Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
Moving your GRAMPS data between computers with different operating systems seems possible, but is '''''NOT''''' officially supported.  '''Do so at your own risk!'''&lt;br /&gt;
&lt;br /&gt;
{{man warn| Backup, backup, backup! |If you do try to move your data between operating systems like this, '''''ALWAYS''''' export your database to GRAMPS XML before changing operating system.  If you don't, you may live to regret it.}}&lt;br /&gt;
&lt;br /&gt;
You can experiment with this by simply putting both the above &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; scripts in the same directory on your removable drive.  If you then run &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; on Windows and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; on Linux, GRAMPS will use the same configuration and data files on both operating systems.&lt;br /&gt;
&lt;br /&gt;
Since this behavior is neither encouraged nor tested, there are any number of possible problems you may encounter.  Here are some of the known problems you will see:&lt;br /&gt;
* When first opening a database after changing operating system, you may get an error that says &amp;quot;Low level database corruption detected&amp;quot; and instructs you to use the Repair button to fix the problem.  This seems to work, but ''it is not known for sure whether any data loss may occur in the process''.&lt;br /&gt;
* You will need to update the media base path in Preferences every time you switch operating system.&lt;br /&gt;
* If your media files are referenced with any directory information (either absolute paths or relative paths with subdirectories), each path will only work on the operating system on which it was entered.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5722</id>
		<title>Run Gramps from a portable drive</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Run_Gramps_from_a_portable_drive&amp;diff=5722"/>
		<updated>2008-03-26T07:35:52Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: Move from sandbox&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How do I...]]&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
If you keep your media files on the removable drive with your GRAMPS data (what use are they otherwise?), be sure to make them use relative paths.  Doing so will allow the paths to continue working as you move between computers (with adjustments to the media base path), while absolute paths are almost certain to break.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to re-edit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
==Software Versions==&lt;br /&gt;
While these instructions help you easily move your GRAMPS data between computers, '''''no''''' testing has been done to explore compatibility between different software versions.  It is recommended that you only move your data between computers that share the same GRAMPS, Python, database and operating system versions.  The more those versions differ, the greater risk of database corruption and data loss.  You are encouraged to export your database to GRAMPS XML for safety when moving the data between computers with differing (or unknown) software versions.  Do this on your known safe computer before moving to an unknown computer, and again when you have finished with GRAMPS on the new computer before moving back to your regular computer.&lt;br /&gt;
&lt;br /&gt;
===GRAMPS===&lt;br /&gt;
GRAMPS 2.x and 3.x are ''NOT'' compatible with each other.  The instructions and scripts here are intended for use with GRAMPS 3.0, and it is highly recommended that you ensure the '''same''' version of GRAMPS is installed on each computer.  A similar technique to that described here could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]].&lt;br /&gt;
&lt;br /&gt;
===Python and Database===&lt;br /&gt;
GRAMPS stores its data with the BSDDB engine bundled with Python.  While the Python and BSDDB developers do make an effort to keep new versions of their software backward compatible, the risk of incompatibility increases with the distance between versions.  To determine the versions of Python and BSDDB on a computer, enter the following commands in a terminal window (the input prompts are &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; python&lt;br /&gt;
Python 2.5.1 (r251:54863, Mar  7 2008, 03:41:45)&lt;br /&gt;
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2&lt;br /&gt;
Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
Moving your GRAMPS data between computers with different operating systems seems possible, but is '''''NOT''''' officially supported.  '''Do so at your own risk!'''&lt;br /&gt;
&lt;br /&gt;
{{man warn| Backup, backup, backup! |If you do try to move your data between operating systems like this, '''''ALWAYS''''' export your database to GRAMPS XML before changing operating system.  If you don't, you may live to regret it.}}&lt;br /&gt;
&lt;br /&gt;
You can experiment with this by simply putting both the above &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; scripts in the same directory on your removable drive.  If you then run &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; on Windows and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; on Linux, GRAMPS will use the same configuration and data files on both operating systems.&lt;br /&gt;
&lt;br /&gt;
Since this behavior is neither encouraged nor tested, there are any number of possible problems you may encounter.  Here are some of the known problems you will see:&lt;br /&gt;
* When first opening a database after changing operating system, you may get an error that says &amp;quot;Low level database corruption detected&amp;quot; and instructs you to use the Repair button to fix the problem.  This seems to work, but ''it is not known for sure whether any data loss may occur in the process''.&lt;br /&gt;
* You will need to update the media base path in Preferences every time you switch operating system.&lt;br /&gt;
* If your media files are referenced with any directory information (either absolute paths or relative paths with subdirectories), each path will only work on the operating system on which it was entered.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5721</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5721"/>
		<updated>2008-03-26T07:26:22Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
If you keep your media files on the removable drive with your GRAMPS data (what use are they otherwise?), be sure to make them use relative paths.  Doing so will allow the paths to continue working as you move between computers (with adjustments to the media base path), while absolute paths are almost certain to break.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to re-edit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==Software Versions==&lt;br /&gt;
While these instructions help you easily move your GRAMPS data between computers, '''''no''''' testing has been done to explore compatibility between different software versions.  It is recommended that you only move your data between computers that share the same GRAMPS, Python, database and operating system versions.  The more those versions differ, the greater risk of database corruption and data loss.  You are encouraged to export your database to GRAMPS XML for safety when moving the data between computers with differing (or unknown) software versions.  Do this on your known safe computer before moving to an unknown computer, and again when you have finished with GRAMPS on the new computer before moving back to your regular computer.&lt;br /&gt;
&lt;br /&gt;
===GRAMPS===&lt;br /&gt;
GRAMPS 2.x and 3.x are ''NOT'' compatible with each other.  The instructions and scripts here are intended for use with GRAMPS 3.0, and it is highly recommended that you ensure the '''same''' version of GRAMPS is installed on each computer.  A similar technique to that described here could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]].&lt;br /&gt;
&lt;br /&gt;
===Python and Database===&lt;br /&gt;
GRAMPS stores its data with the BSDDB engine bundled with Python.  While the Python and BSDDB developers do make an effort to keep new versions of their software backward compatible, the risk of incompatibility increases with the distance between versions.  To determine the versions of Python and BSDDB on a computer, enter the following commands in a terminal window (the input prompts are &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; python&lt;br /&gt;
Python 2.5.1 (r251:54863, Mar  7 2008, 03:41:45)&lt;br /&gt;
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2&lt;br /&gt;
Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
Moving your GRAMPS data between computers with different operating systems seems possible, but is '''''NOT''''' officially supported.  '''Do so at your own risk!'''&lt;br /&gt;
&lt;br /&gt;
{{man warn| Backup, backup, backup! |If you do try to move your data between operating systems like this, '''''ALWAYS''''' export your database to GRAMPS XML before changing operating system.  If you don't, you may live to regret it.}}&lt;br /&gt;
&lt;br /&gt;
You can experiment with this by simply putting both the above &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; scripts in the same directory on your removable drive.  If you then run &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; on Windows and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; on Linux, GRAMPS will use the same configuration and data files on both operating systems.&lt;br /&gt;
&lt;br /&gt;
Since this behavior is neither encouraged nor tested, there are any number of possible problems you may encounter.  Here are some of the known problems you will see:&lt;br /&gt;
* When first opening a database after changing operating system, you may get an error that says &amp;quot;Low level database corruption detected&amp;quot; and instructs you to use the Repair button to fix the problem.  This seems to work, but ''it is not known for sure whether any data loss may occur in the process''.&lt;br /&gt;
* You will need to update the media base path in Preferences every time you switch operating system.&lt;br /&gt;
* If your media files are referenced with any directory information (either absolute paths or relative paths with subdirectories), each path will only work on the operating system on which it was entered.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5720</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5720"/>
		<updated>2008-03-26T07:20:23Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==Software Versions==&lt;br /&gt;
While these instructions help you easily move your GRAMPS data between computers, '''''no''''' testing has been done to explore compatibility between different software versions.  It is recommended that you only move your data between computers that share the same GRAMPS, Python, database and operating system versions.  The more those versions differ, the greater risk of database corruption and data loss.  You are encouraged to export your database to GRAMPS XML for safety when moving the data between computers with differing (or unknown) software versions.  Do this on your known safe computer before moving to an unknown computer, and again when you have finished with GRAMPS on the new computer before moving back to your regular computer.&lt;br /&gt;
&lt;br /&gt;
===GRAMPS===&lt;br /&gt;
GRAMPS 2.x and 3.x are ''NOT'' compatible with each other.  The instructions and scripts here are intended for use with GRAMPS 3.0, and it is highly recommended that you ensure the '''same''' version of GRAMPS is installed on each computer.  A similar technique to that described here could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]].&lt;br /&gt;
&lt;br /&gt;
===Python and Database===&lt;br /&gt;
GRAMPS stores its data with the BSDDB engine bundled with Python.  While the Python and BSDDB developers do make an effort to keep new versions of their software backward compatible, the risk of incompatibility increases with the distance between versions.  To determine the versions of Python and BSDDB on a computer, enter the following commands in a terminal window (the input prompts are &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; python&lt;br /&gt;
Python 2.5.1 (r251:54863, Mar  7 2008, 03:41:45)&lt;br /&gt;
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2&lt;br /&gt;
Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
Moving your GRAMPS data between computers with different operating systems seems possible, but is '''''NOT''''' officially supported.  '''Do so at your own risk!'''&lt;br /&gt;
&lt;br /&gt;
{{man warn| Backup, backup, backup! |If you do try to move your data between operating systems like this, '''''ALWAYS''''' export your database to GRAMPS XML before changing operating system.  If you don't, you may live to regret it.}}&lt;br /&gt;
&lt;br /&gt;
You can experiment with this by simply putting both the above &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; scripts in the same directory on your removable drive.  If you then run &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; on Windows and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; on Linux, GRAMPS will use the same configuration and data files on both operating systems.&lt;br /&gt;
&lt;br /&gt;
Since this behavior is neither encouraged nor tested, there are any number of possible problems you may encounter.  Here are some of the known problems you will see:&lt;br /&gt;
* When first opening a database after changing operating system, you may get an error that says &amp;quot;Low level database corruption detected&amp;quot; and instructs you to use the Repair button to fix the problem.  This seems to work, but ''it is not known for sure whether any data loss may occur in the process''.&lt;br /&gt;
* You will need to update the media base path in Preferences every time you switch operating system.&lt;br /&gt;
* If your media files are referenced with any directory information (either absolute paths or relative paths with subdirectories), each path will only work on the operating system on which it was entered.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5719</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5719"/>
		<updated>2008-03-26T07:13:15Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Python and Database Versions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==Software Versions==&lt;br /&gt;
While these instructions help you easily move your GRAMPS data between computers, '''''no''''' testing has been done to explore compatibility between different software versions.  It is recommended that you only move your data between computers that share the same operating system, Python, and database versions.  The more those versions differ, the greater risk of database corruption and data loss.  You are encouraged to export your database to GRAMPS XML for safety when moving the data between computers with differing (or unknown) software versions.  Do this on your known safe computer before moving to an unknown computer, and again when you have finished with GRAMPS on the new computer before moving back to your regular computer.&lt;br /&gt;
&lt;br /&gt;
===Python and Database===&lt;br /&gt;
GRAMPS stores its data with the BSDDB engine bundled with Python.  While the Python and BSDDB developers do make an effort to keep new versions of their software backward compatible, the risk of incompatibility increases with the distance between versions.  To determine the versions of Python and BSDDB on a computer, enter the following commands in a terminal window (the input prompts are &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; python&lt;br /&gt;
Python 2.5.1 (r251:54863, Mar  7 2008, 03:41:45)&lt;br /&gt;
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2&lt;br /&gt;
Type &amp;quot;help&amp;quot;, &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
Moving your GRAMPS data between computers with different operating systems seems possible, but is '''''NOT''''' officially supported.  '''Do so at your own risk!'''&lt;br /&gt;
&lt;br /&gt;
{{man warn| Backup, backup, backup! |If you do try to move your data between operating systems like this, '''''ALWAYS''''' export your database to GRAMPS XML before changing operating system.  If you don't, you may live to regret it.}}&lt;br /&gt;
&lt;br /&gt;
You can experiment with this by simply putting both the above &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; scripts in the same directory on your removable drive.  If you then run &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; on Windows and &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; on Linux, GRAMPS will use the same configuration and data files on both operating systems.&lt;br /&gt;
&lt;br /&gt;
Since this behavior is neither encouraged nor tested, there are any number of possible problems you may encounter.  Here are some of the known problems you will see:&lt;br /&gt;
* When first opening a database after changing operating system, you may get an error that says &amp;quot;Low level database corruption detected&amp;quot; and instructs you to use the Repair button to fix the problem.  This seems to work, but ''it is not known for sure whether any data loss may occur in the process''.&lt;br /&gt;
* You will need to update the media base path in Preferences every time you switch operating system.&lt;br /&gt;
* If your media files are referenced with any directory information (either absolute paths or relative paths with subdirectories), each path will only work on the operating system on which it was entered.&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5718</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5718"/>
		<updated>2008-03-26T06:15:17Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Benny Malengier */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==Python and Database Versions==&lt;br /&gt;
Benny Malengier&lt;br /&gt;
2008/3/20, Jonathan Hipkiss:&lt;br /&gt;
&lt;br /&gt;
    Oh dear, that's bad news I think.  I am in the process of installing&lt;br /&gt;
    Gramps on a number of PCs at home ( a laptop and desktop ) so I can use&lt;br /&gt;
    either to update my stuff, but I'm saving the data files on a network share!&lt;br /&gt;
&lt;br /&gt;
      From reading that page it sounds like that's a no no?&lt;br /&gt;
&lt;br /&gt;
It is possible, but you have to tweak the code at the moment. Best is to use the .gramps format at the moment and export to .gramps at end, and import again before you start.&lt;br /&gt;
&lt;br /&gt;
In upcoming version 3.0 (a .0 release might be available over the weekend) you can set the database position in the preferences of GRAMPS. If you then make sure to use the same !!!! python !!!! version from the same OS, it should be no problem to work from a network share. I say same python version as we use the bsddb engine of python for the database, so it might be important (no experience) to use the same engine to access the database, as the engine will run on your local PC.&lt;br /&gt;
If you use different OS's this might be a problem. To know your version of bsddb on each PC, do the following in a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above is the version.&lt;br /&gt;
The problem is the same as running data from a USB stick. A user is experimenting with this here: http://www.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&lt;br /&gt;
You can help with setting up a dedicated wiki page for USB key or shared network hosting of the database (.grdb in 3.0 family trees) in GRAMPS.&lt;br /&gt;
&lt;br /&gt;
Benny&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5717</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5717"/>
		<updated>2008-03-26T06:14:44Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Changing Operating System */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==Python and Database Versions==&lt;br /&gt;
===Benny Malengier===&lt;br /&gt;
2008/3/20, Jonathan Hipkiss:&lt;br /&gt;
&lt;br /&gt;
    Oh dear, that's bad news I think.  I am in the process of installing&lt;br /&gt;
    Gramps on a number of PCs at home ( a laptop and desktop ) so I can use&lt;br /&gt;
    either to update my stuff, but I'm saving the data files on a network share!&lt;br /&gt;
&lt;br /&gt;
      From reading that page it sounds like that's a no no?&lt;br /&gt;
&lt;br /&gt;
It is possible, but you have to tweak the code at the moment. Best is to use the .gramps format at the moment and export to .gramps at end, and import again before you start.&lt;br /&gt;
&lt;br /&gt;
In upcoming version 3.0 (a .0 release might be available over the weekend) you can set the database position in the preferences of GRAMPS. If you then make sure to use the same !!!! python !!!! version from the same OS, it should be no problem to work from a network share. I say same python version as we use the bsddb engine of python for the database, so it might be important (no experience) to use the same engine to access the database, as the engine will run on your local PC.&lt;br /&gt;
If you use different OS's this might be a problem. To know your version of bsddb on each PC, do the following in a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above is the version.&lt;br /&gt;
The problem is the same as running data from a USB stick. A user is experimenting with this here: http://www.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&lt;br /&gt;
You can help with setting up a dedicated wiki page for USB key or shared network hosting of the database (.grdb in 3.0 family trees) in GRAMPS.&lt;br /&gt;
&lt;br /&gt;
Benny&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5681</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5681"/>
		<updated>2008-03-24T05:12:10Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* GRAMPS 2.2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==Python and Database Versions==&lt;br /&gt;
===Benny Malengier===&lt;br /&gt;
2008/3/20, Jonathan Hipkiss:&lt;br /&gt;
&lt;br /&gt;
    Oh dear, that's bad news I think.  I am in the process of installing&lt;br /&gt;
    Gramps on a number of PCs at home ( a laptop and desktop ) so I can use&lt;br /&gt;
    either to update my stuff, but I'm saving the data files on a network share!&lt;br /&gt;
&lt;br /&gt;
      From reading that page it sounds like that's a no no?&lt;br /&gt;
&lt;br /&gt;
It is possible, but you have to tweak the code at the moment. Best is to use the .gramps format at the moment and export to .gramps at end, and import again before you start.&lt;br /&gt;
&lt;br /&gt;
In upcoming version 3.0 (a .0 release might be available over the weekend) you can set the database position in the preferences of GRAMPS. If you then make sure to use the same !!!! python !!!! version from the same OS, it should be no problem to work from a network share. I say same python version as we use the bsddb engine of python for the database, so it might be important (no experience) to use the same engine to access the database, as the engine will run on your local PC.&lt;br /&gt;
If you use different OS's this might be a problem. To know your version of bsddb on each PC, do the following in a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import bsddb&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; bsddb.__version__&lt;br /&gt;
'4.4.5.2'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above is the version.&lt;br /&gt;
The problem is the same as running data from a USB stick. A user is experimenting with this here: http://www.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&lt;br /&gt;
You can help with setting up a dedicated wiki page for USB key or shared network hosting of the database (.grdb in 3.0 family trees) in GRAMPS.&lt;br /&gt;
&lt;br /&gt;
Benny&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing Operating System==&lt;br /&gt;
Write something here...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5680</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5680"/>
		<updated>2008-03-24T03:31:46Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts figure out the location of the directory they are run from, on your removable drive, then tell GRAMPS to use that directory as its home directory.  They do that using the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable, which GRAMPS checks to see if its home directory should be somewhere other than the user's home directory.  GRAMPS will then read and write its configuration and data to a subdirectory named &amp;lt;code&amp;gt;gramps&amp;lt;/code&amp;gt; in directory that contains these scripts.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  The batch file uses these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, then change drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5679</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5679"/>
		<updated>2008-03-24T03:24:25Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  &lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the batch file uses &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; to set &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to the batch file directory, then changes drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd `$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;` &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to change directory to the location of this script, and to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.  Because the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is set on the same line as the command to run GRAMPS, that value is only used for that command and will not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5678</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5678"/>
		<updated>2008-03-24T03:11:19Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* How it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  &lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the batch file uses &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; to set &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to the batch file directory, then changes drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5677</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5677"/>
		<updated>2008-03-24T03:09:34Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  &lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the batch file uses &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; to set &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to the batch file directory, then changes drive and directory to that location.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the batch file runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5676</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5676"/>
		<updated>2008-03-24T03:05:22Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* How it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to set the value of &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt;, change drive to the removable drive, and change directory to the directory which contains this batch file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; is the environment variable that GRAMPS uses to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5675</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5675"/>
		<updated>2008-03-24T03:03:08Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in this batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your removable drive.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5674</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5674"/>
		<updated>2008-03-24T03:00:09Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set GRAMPSHOME to the drive and path of this script&lt;br /&gt;
set GRAMPSHOME=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5671</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5671"/>
		<updated>2008-03-23T04:51:21Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
REM Run GRAMPS&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5670</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5670"/>
		<updated>2008-03-23T04:50:40Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
# Set GRAMPSHOME to the path of this script&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
# Go to this script location for good measure&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5669</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5669"/>
		<updated>2008-03-23T04:48:21Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=C:\Python25\pythonw.exe&lt;br /&gt;
set GRAMPS_DIR=C:\Program Files\gramps&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5668</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5668"/>
		<updated>2008-03-23T04:39:51Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* How it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
GRAMPS checks the &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; environment variable to see if its home directory should be somewhere other than the user's home directory.  So the script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, sets &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; to that directory, then changes directory to that location.  The &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; command puts &amp;lt;code&amp;gt;GRAMPSHOME&amp;lt;/code&amp;gt; into the global environment so that it is available to GRAMPS, instead of just being local to this script.&lt;br /&gt;
&lt;br /&gt;
Once that is set up, the script runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5667</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5667"/>
		<updated>2008-03-23T04:31:35Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in this script (or a copy of it) to match the target computer.&lt;br /&gt;
# Edit gramps/keys.ini and remove database-path from the [behavior] section, if present.&lt;br /&gt;
# Run this script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, then changes directory to that location.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; is the environment variable that Linux programs use to locate your user home directory. We need to set it to point to the directory where the script lives, in order to trick GRAMPS into thinking that is your home directory.  But Linux programs also need the file &amp;lt;code&amp;gt;.Xauthority&amp;lt;/code&amp;gt; in your home directory to gain permission to open a window.  So first we need to set &amp;lt;code&amp;gt;XAUTHORITY&amp;lt;/code&amp;gt; to point to that file so that it can still be found, and then we can go ahead and set &amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;$PWD&amp;lt;/code&amp;gt;, which indicates the directory the script changed to earlier.&lt;br /&gt;
&lt;br /&gt;
Once those values are set up, the script runs GRAMPS. Because the values of &amp;lt;code&amp;gt;XAUTHORITY&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; are set on the same line as the command to run GRAMPS, those values are only used for that command and do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5666</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5666"/>
		<updated>2008-03-23T04:29:59Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in the script (or a copy of it) to match the target computer.&lt;br /&gt;
# If necessary, edit gramps/keys.ini and remove database-path from the [behavior] section.&lt;br /&gt;
# Run the script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, then changes directory to that location.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; is the environment variable that Linux programs use to locate your user home directory. We need to set it to point to the directory where the script lives, in order to trick GRAMPS into thinking that is your home directory.  But Linux programs also need the file &amp;lt;code&amp;gt;.Xauthority&amp;lt;/code&amp;gt; in your home directory to gain permission to open a window.  So first we need to set &amp;lt;code&amp;gt;XAUTHORITY&amp;lt;/code&amp;gt; to point to that file so that it can still be found, and then we can go ahead and set &amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;$PWD&amp;lt;/code&amp;gt;, which indicates the directory the script changed to earlier.&lt;br /&gt;
&lt;br /&gt;
Once those values are set up, the script runs GRAMPS. Because the values of &amp;lt;code&amp;gt;XAUTHORITY&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; are set on the same line as the command to run GRAMPS, those values are only used for that command and do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5665</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5665"/>
		<updated>2008-03-23T04:27:38Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
export GRAMPSHOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPSHOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in the script (or a copy of it) to match the target computer.&lt;br /&gt;
# If necessary, edit .gramps/keys.ini and adjust database-path to match your mount point.&lt;br /&gt;
# Run the script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, then changes directory to that location.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; is the environment variable that Linux programs use to locate your user home directory. We need to set it to point to the directory where the script lives, in order to trick GRAMPS into thinking that is your home directory.  But Linux programs also need the file &amp;lt;code&amp;gt;.Xauthority&amp;lt;/code&amp;gt; in your home directory to gain permission to open a window.  So first we need to set &amp;lt;code&amp;gt;XAUTHORITY&amp;lt;/code&amp;gt; to point to that file so that it can still be found, and then we can go ahead and set &amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;$PWD&amp;lt;/code&amp;gt;, which indicates the directory the script changed to earlier.&lt;br /&gt;
&lt;br /&gt;
Once those values are set up, the script runs GRAMPS. Because the values of &amp;lt;code&amp;gt;XAUTHORITY&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; are set on the same line as the command to run GRAMPS, those values are only used for that command and do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5632</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5632"/>
		<updated>2008-03-21T07:03:44Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{{man warn| Make Regular Backups |Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer.&lt;br /&gt;
# If necessary, edit the settings in the batch file (or a copy of it) to match the target computer.&lt;br /&gt;
# Double click the batch file to run GRAMPS.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_HOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPS_HOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
# Make sure GRAMPS is installed and working on the target computer.&lt;br /&gt;
# Attach your drive to the target computer and mount it.&lt;br /&gt;
# If necessary, edit the settings in the script (or a copy of it) to match the target computer.&lt;br /&gt;
# If necessary, edit .gramps/keys.ini and adjust database-path to match your mount point.&lt;br /&gt;
# Run the script using its full path to run GRAMPS.&lt;br /&gt;
# If necessary, edit the media base path in GRAMPS to match your mount point.&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
This is a little less forgiving than the Windows version, because bash doesn't have the equivalent of the Windows %0 modifiers.  $0 only contains exactly what was used to start the script, so if you don't use the full path to the script (for example, if it's on the search path), the script has no way to determine where it is located.&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;&amp;lt;code&amp;gt;dirname $0&amp;lt;/code&amp;gt;&amp;quot; to determine the directory it is in, then changes directory to that location.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; is the environment variable that Linux programs use to locate your user home directory. We need to set it to point to the directory where the script lives, in order to trick GRAMPS into thinking that is your home directory.  But Linux programs also need the file &amp;lt;code&amp;gt;.Xauthority&amp;lt;/code&amp;gt; in your home directory to gain permission to open a window.  So first we need to set &amp;lt;code&amp;gt;XAUTHORITY&amp;lt;/code&amp;gt; to point to that file so that it can still be found, and then we can go ahead and set &amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;$PWD&amp;lt;/code&amp;gt;, which indicates the directory the script changed to earlier.&lt;br /&gt;
&lt;br /&gt;
Once those values are set up, the script runs GRAMPS. Because the values of &amp;lt;code&amp;gt;XAUTHORITY&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;HOME&amp;lt;/code&amp;gt; are set on the same line as the command to run GRAMPS, those values are only used for that command and do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5631</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5631"/>
		<updated>2008-03-21T06:22:34Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* How it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_HOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPS_HOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5630</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5630"/>
		<updated>2008-03-21T06:21:59Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* How it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_HOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPS_HOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5629</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5629"/>
		<updated>2008-03-21T06:21:20Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Dave Walton */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_HOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPS_HOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5628</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5628"/>
		<updated>2008-03-21T06:19:30Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Jim Sack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_HOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPS_HOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5627</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5627"/>
		<updated>2008-03-21T06:16:58Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Jim Sack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_HOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPS_HOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5626</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5626"/>
		<updated>2008-03-21T06:15:20Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Jim Sack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_HOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPS_HOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5625</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5625"/>
		<updated>2008-03-21T06:13:55Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* &amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_HOME=`$DIRNAME_COMMAND &amp;quot;$0&amp;quot;`&lt;br /&gt;
cd &amp;quot;$GRAMPS_HOME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5624</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5624"/>
		<updated>2008-03-21T03:28:53Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# You MUST use the full path to this script when you run it.&lt;br /&gt;
&lt;br /&gt;
# START OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
GRAMPS_COMMAND=&amp;quot;/usr/bin/gramps&amp;quot;&lt;br /&gt;
DIRNAME_COMMAND=&amp;quot;/usr/bin/dirname&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
cd `$DIRNAME_COMMAND $0`&lt;br /&gt;
&lt;br /&gt;
# Set XAUTHORITY so that HOME isn't relied on for magic cookie&lt;br /&gt;
# Set HOME to the current directory&lt;br /&gt;
# Run GRAMPS&lt;br /&gt;
XAUTHORITY=&amp;quot;$HOME/.Xauthority&amp;quot; HOME=&amp;quot;$PWD&amp;quot; &amp;quot;$GRAMPS_COMMAND&amp;quot; &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5623</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5623"/>
		<updated>2008-03-21T02:17:28Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* GRAMPS 2.2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM BEGINNING OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
The instructions and scripts here are intended for use with GRAMPS 3.0.  A similar technique could be used with GRAMPS 2.2, but doing so is discouraged due to the risk of [[Recover corrupted grdb|database corruption]], especially on Linux.&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5622</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5622"/>
		<updated>2008-03-21T01:58:20Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  &lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts below in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the SETTINGS section of the scripts you will use, so that the values there are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
You will probably need to change the media base path setting in GRAMPS each time you run it on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM BEGINNING OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5621</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5621"/>
		<updated>2008-03-21T01:52:42Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Run GRAMPS from a portable drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;Run GRAMPS from a portable drive&amp;lt;/font&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!-- Page title.  Remove this line and up before putting in final home. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;left&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
| {{man warn| Make Regular Backups |&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  The process is mostly transparent, but you will probably need to edit the media base path each time you run GRAMPS on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the script you will use, so that the values in the SETTINGS section are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM BEGINNING OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;gramps.sh&amp;lt;/code&amp;gt;===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5620</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5620"/>
		<updated>2008-03-21T01:17:47Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Run GRAMPS from a portable drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Run GRAMPS from a portable drive=&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are no easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
'''''NOTE:'''''&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  The process is mostly transparent, but you will probably need to edit the media base path each time you run GRAMPS on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the script you will use, so that the values in the SETTINGS section are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
Save this on your removable drive as &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM BEGINNING OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5616</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5616"/>
		<updated>2008-03-19T06:17:45Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Run GRAMPS from a portable drive=&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy disk, a flash drive, or an external hard drive.  Unfortunately, there are not any easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
'''''NOTE:'''''&lt;br /&gt;
Since removable drives can be more fragile and more easily lost than the hard drive in your computer, be sure to make regular backups of your data if you use this technique.  For that matter, you should always make regular backups of important data anyway, because stuff can happen to your hard drive, too.  But be especially careful if your data is stored on floppies or flash drives.&lt;br /&gt;
&lt;br /&gt;
==What this does==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  The process is mostly transparent, but you will probably need to edit the media base path each time you run GRAMPS on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the script you will use, so that the values in the SETTINGS section are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
Save this on your removable drive as &amp;lt;code&amp;gt;gramps.bat&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM BEGINNING OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
set PYTHON_COMMAND=&amp;quot;C:\Python25\pythonw.exe&amp;quot;&lt;br /&gt;
set GRAMPS_DIR=&amp;quot;C:\Program Files\gramps&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM END OF SETTINGS&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=&amp;quot;%~dp0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;%PYTHON_COMMAND&amp;quot; &amp;quot;%GRAMPS_DIR\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How it works===&lt;br /&gt;
The &amp;lt;code&amp;gt;setlocal&amp;lt;/code&amp;gt; command tells Windows that you want to use a temporary copy of the environment that will be discarded later.  The &amp;lt;code&amp;gt;endlocal&amp;lt;/code&amp;gt; command tells Windows to go ahead and throw away that temporary environment.  What this does is ensure that any changes made to the environment in the script (especially to &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;) do not carry on past the end of the script.&lt;br /&gt;
&lt;br /&gt;
Batch files use &amp;lt;code&amp;gt;%0&amp;lt;/code&amp;gt; to refer to the drive, path and name of the batch file itself.  You can also insert codes to reference specific parts of the batch file location.  For example, &amp;lt;code&amp;gt;%~d0&amp;lt;/code&amp;gt; refers to just the drive letter, and &amp;lt;code&amp;gt;%~p0&amp;lt;/code&amp;gt; refers to just the path.  These codes can be combined.  Thus, &amp;lt;code&amp;gt;%~dp0&amp;lt;/code&amp;gt; refers to the drive letter and path where the batch file is located.  We use these to change drive to the removable drive, change directory to the directory which contains the script, and set the value of &amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;USERPROFILE&amp;lt;/code&amp;gt; is the environment variable that Windows programs use to locate your user home directory.  Here we set it to point to the drive and directory where this script lives, in order to trick GRAMPS into thinking that is your home directory.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up, the script simply runs GRAMPS.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don gets GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5615</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5615"/>
		<updated>2008-03-19T05:37:27Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Run GRAMPS from a portable drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Run GRAMPS from a portable drive=&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This document describes how to accomplish that, and should work whether using a floppy, a flash drive, or an external hard drive.  Unfortunately, there are not any easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
==How it works==&lt;br /&gt;
The magic is done in scripts that you use to start GRAMPS.  The scripts trick GRAMPS into thinking that your user home directory is on the removable drive instead of in the usual place, so that GRAMPS will read and write its configuration and data there.  The process is mostly transparent, but you will probably need to edit the media base path each time you run GRAMPS on a different computer.  You may also need to edit some settings in the scripts for different computers.  If there are certain computers which you use regularly that need different settings in the scripts, you can easily make separate script copies for each one, to avoid the need to reedit them.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Save the scripts in the directory you want to use as your GRAMPS home directory on the removable drive.  When run, the scripts will direct GRAMPS to the directory they are installed in.  Edit the script you will use, so that the values in the Settings section are correct for your computer.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===Maemo===&lt;br /&gt;
If Don get GRAMPS ported to his Nokia N810, a variation of this script ought to work there, too.  That would allow keeping the data on a flash drive, and switching back and forth between PC and N810 GRAMPS.  Please, Don?  :)&lt;br /&gt;
&lt;br /&gt;
==GRAMPS 2.2==&lt;br /&gt;
&lt;br /&gt;
=========================&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5614</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5614"/>
		<updated>2008-03-19T05:10:26Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* Run GRAMPS from a portable drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Run GRAMPS from a portable drive=&lt;br /&gt;
&lt;br /&gt;
Some users want to keep their GRAMPS data on a removable drive, either for portability between computers or for security.  This describes how to accomplish that, and should work whether using a floppy, a flash drive, or an external hard drive.  Unfortunately, there are not any easy instructions for installing GRAMPS and its dependencies on a removable drive, so these instructions assume and require that GRAMPS be installed on any computer to which you connect the drive.&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5613</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5613"/>
		<updated>2008-03-19T04:55:12Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Run GRAMPS from a portable drive=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[:Category:How do I...]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5612</id>
		<title>User:Diggernet/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=User:Diggernet/Sandbox&amp;diff=5612"/>
		<updated>2008-03-19T04:17:30Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: Gather up old emails for source material&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Run GRAMPS from a portable drive=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[[Category:Tutorials]] [[Category:Documentation]] [[Category:How do I...]]&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Hmmm, have you tried something like starting gramps  with some&lt;br /&gt;
environment variable help?&lt;br /&gt;
&lt;br /&gt;
In *nix, it should even work as from the command line:&lt;br /&gt;
&lt;br /&gt;
 HOME=/media/usb_volname/GDB gramps&lt;br /&gt;
&lt;br /&gt;
Or on Windows, maybe a .bat file (some guesswork here -- not tested!)&lt;br /&gt;
&lt;br /&gt;
 oup=%USERPROFILE%&lt;br /&gt;
 set USERPROFILE=e:\GDB&lt;br /&gt;
 gramps&lt;br /&gt;
 set USERPROFILE=%oup%&lt;br /&gt;
&lt;br /&gt;
This probably needs more help. Maybe pass the drive letter as a parm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Anyway, the idea is that the database and preferences would both be in&lt;br /&gt;
the GDB dir of the removable device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dave Walton==&lt;br /&gt;
Why no, as a matter of fact, I had NOT tried something like that.  Nor&lt;br /&gt;
would I have known which var to mess with.  Thanks for the tip!&lt;br /&gt;
&lt;br /&gt;
Using your Windows example as a starting point, I came up with this&lt;br /&gt;
batch file, which I call gramps.bat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM Make changes to environment variables local to this block&lt;br /&gt;
setlocal&lt;br /&gt;
&lt;br /&gt;
REM Set USERPROFILE to the drive and path of this script&lt;br /&gt;
set USERPROFILE=%~dp0&lt;br /&gt;
&lt;br /&gt;
REM Go to this script location for good measure&lt;br /&gt;
%~d0&lt;br /&gt;
cd &amp;quot;%~p0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM I don't know how to locate and start GRAMPS without hardcoding&lt;br /&gt;
REM the drive and path for it and Python.&lt;br /&gt;
C:\Python25\pythonw.exe &amp;quot;C:\Program Files\gramps\gramps.py&amp;quot;&lt;br /&gt;
&lt;br /&gt;
REM End the local environment block&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this script is run, it starts gramps with the profile set to the&lt;br /&gt;
drive and directory that contains the script.  So you attach the drive,&lt;br /&gt;
double click the batch file, and gramps starts up, no matter which&lt;br /&gt;
letter the drive got.  Assuming windows gramps and all its dependencies&lt;br /&gt;
are correctly installed on that computer, of course.  If I knew how to&lt;br /&gt;
set up those on the removable drive, too, it'd be perfect.  But this&lt;br /&gt;
path stuff was the most critical part of the problem.&lt;br /&gt;
&lt;br /&gt;
Right now I'm stuck on a loaner computer, but when I get a new one set&lt;br /&gt;
up I'll be able to do a *nix version, too.  They'd also be good content&lt;br /&gt;
for a &amp;quot;How do I...&amp;quot; on the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Yea! That would be great. You might also add an expanded discussion&lt;br /&gt;
version (or footnotes) explaining the technical/syntax details.&lt;br /&gt;
&lt;br /&gt;
I await the educational opportunity.  :-) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Jim Sack==&lt;br /&gt;
Benny Malengier wrote:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;gt; How do I run GRAMPS from a stick?&lt;br /&gt;
&lt;br /&gt;
I think Dave will be explaining it in human language, but here it is in&lt;br /&gt;
geek:&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps /media/disk/&lt;br /&gt;
 HOME=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
when you plug it into someone else's machine, you have to substitute the&lt;br /&gt;
appropriate mount point on that host for the HOME value.&lt;br /&gt;
&lt;br /&gt;
To accommodate visiting relatives running Windows, you might do&lt;br /&gt;
&lt;br /&gt;
 cp -a ~/.gramps/* /media/disk/gramps&lt;br /&gt;
 USERPROFILE=/media/disk gramps&lt;br /&gt;
&lt;br /&gt;
Well, sorry, but that doesn't quite work in Linux -- it almost does,&lt;br /&gt;
except for a hardcoded&lt;br /&gt;
 DATABASE_PATH : '~/.gramps/grampsdb'&lt;br /&gt;
in Config/_GrampsConfigKeys.py&lt;br /&gt;
&amp;lt;maybe that sh/could be fixed?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll probably want to put Dave's batch file to do the trick on the&lt;br /&gt;
actual Windows system. a dos shortcut file might actually allow the same&lt;br /&gt;
database to work on Win and Linux. Hmmm, how does one make a shortcut&lt;br /&gt;
file on (eg) vfat from linux?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Add_a_child&amp;diff=4397</id>
		<title>Add a child</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Add_a_child&amp;diff=4397"/>
		<updated>2007-12-17T06:41:02Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: /* How do I add twins/triplets/etc? */ Tag labels and buttons&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How do I...]]&lt;br /&gt;
&lt;br /&gt;
= How do I add a child to a Person or Family? =&lt;br /&gt;
&lt;br /&gt;
Children are not added to a Person. Children are added to a Family. A Child may belong to more than one family.&lt;br /&gt;
&lt;br /&gt;
== Adding a child from the Relationship View ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A child may be added to a family in several ways, depending on the context.&lt;br /&gt;
&lt;br /&gt;
The Relationship View displays the active person. From this View, you may:&lt;br /&gt;
&lt;br /&gt;
* Add the active person as a child of a family&lt;br /&gt;
* Add another person as a child of one of the families in which the active person is a parent&lt;br /&gt;
&lt;br /&gt;
=== Adding the Active Person as a Child in a family ===&lt;br /&gt;
&lt;br /&gt;
You may either add the Active Person as a child of a new family, or as the child of an existing family. &lt;br /&gt;
&lt;br /&gt;
To add the Active Person as a child of a new family, select the {{man button|Add New Parents}} button from the toolbar (in older versions of GRAMPS, this button was simply called ''Add'').  This will bring up a new Edit Family form with the Active Person listed as a child. You can then add parents by selecting existing people from the database or by creating new people.&lt;br /&gt;
&lt;br /&gt;
To add the Active Person as a child of an existing family, select the {{man button|Add Existing Parents}} button from the toolbar (in older versions of GRAMPS, this button was simply called ''Share''). This will allow you to select an existing family, and adds the Active Person as a child of that family.&lt;br /&gt;
&lt;br /&gt;
=== Adding a Person as a Child of the Active Person ===&lt;br /&gt;
&lt;br /&gt;
You may add a child to a family in which the Active Person is a parent in one of two ways. If the family already exists, then it will appear in the {{man label|Family}} section of the display. Click on the {{man label|edit}} icon, and the exiting family will be displayed in the Edit Family form.&lt;br /&gt;
&lt;br /&gt;
If the family to which you want to add a child is not displayed, then you should select the {{man button|Add Partner}} button (in older versions of GRAMPS, this button was simply called {{man label|Spouse}}). This will display an Edit Family form in which the Active Person is listed as either the father or the mother. At this point, you may add children and/or a spouse.&lt;br /&gt;
&lt;br /&gt;
== Adding a child from the Family View ==&lt;br /&gt;
[[image:edit-rel.png|right|thumb|250px| Family view]]&lt;br /&gt;
&lt;br /&gt;
If you wish to add a child to an existing family from the Family View, find the Family in the displayed list. You may either select the family a click on the {{man button|Edit}} button in the toolbar, or double-click on the family in the list. This will display the Edit Family form for this person. At this point, you may add the child.&lt;br /&gt;
&lt;br /&gt;
If you wish to add a child to a new family (a family that does not yet exist in the database), click on the {{man button|Add}} button on the toolbar. This will bring up an Edit Family form. On this form, you may add parents and children.&lt;br /&gt;
&lt;br /&gt;
= How do I add twins/triplets/etc? =&lt;br /&gt;
When you look at the list of children in a family, those with the same birthdate are obviously twins.  But if you don't know the birthdate, or only know the year, you need some other way to indicate the relationship.  You can do this by having them share a single birth event.&lt;br /&gt;
&lt;br /&gt;
Take for example, the twins Thomas and Peter.  When you create the Birth event for Thomas, make the {{man label|Description}} say &amp;quot;Birth of Thomas and Peter&amp;quot;.  Then add a reference to that same event to Peter's event list, either by drag and drop, or by using the {{man button|Share an existing event}} button.  Set the {{man label|Role}} for that event for both people to &amp;quot;Primary&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now when you view the event list for either Thomas or Peter, you will see the {{man label|Description}} reminding you that they are twins.  And as you add details such as birth date to the birth event for either of them, those details will automatically display for the other as well.&lt;br /&gt;
&lt;br /&gt;
= Adding other informations =&lt;br /&gt;
== Adding an occupation or other special informations ==&lt;br /&gt;
It is sometimes indicated in old documents that the person's activity was brewer, nails maker, woodchoper, ...&lt;br /&gt;
Edit the person and select the Attribute Tab. There add a new Attribute to add &amp;amp; select the wished information type you want to add &lt;br /&gt;
&lt;br /&gt;
== Related articles ==&lt;br /&gt;
*[[Add a spouse]]&lt;br /&gt;
*[[Add a godfather-godmother]]&lt;br /&gt;
*[[Add a witness]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
	<entry>
		<id>https://blog.gramps-project.org/wiki/index.php?title=Add_a_child&amp;diff=4396</id>
		<title>Add a child</title>
		<link rel="alternate" type="text/html" href="https://blog.gramps-project.org/wiki/index.php?title=Add_a_child&amp;diff=4396"/>
		<updated>2007-12-17T06:12:36Z</updated>

		<summary type="html">&lt;p&gt;Diggernet: Add section describing how to add twins&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:How do I...]]&lt;br /&gt;
&lt;br /&gt;
= How do I add a child to a Person or Family? =&lt;br /&gt;
&lt;br /&gt;
Children are not added to a Person. Children are added to a Family. A Child may belong to more than one family.&lt;br /&gt;
&lt;br /&gt;
== Adding a child from the Relationship View ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A child may be added to a family in several ways, depending on the context.&lt;br /&gt;
&lt;br /&gt;
The Relationship View displays the active person. From this View, you may:&lt;br /&gt;
&lt;br /&gt;
* Add the active person as a child of a family&lt;br /&gt;
* Add another person as a child of one of the families in which the active person is a parent&lt;br /&gt;
&lt;br /&gt;
=== Adding the Active Person as a Child in a family ===&lt;br /&gt;
&lt;br /&gt;
You may either add the Active Person as a child of a new family, or as the child of an existing family. &lt;br /&gt;
&lt;br /&gt;
To add the Active Person as a child of a new family, select the {{man button|Add New Parents}} button from the toolbar (in older versions of GRAMPS, this button was simply called ''Add'').  This will bring up a new Edit Family form with the Active Person listed as a child. You can then add parents by selecting existing people from the database or by creating new people.&lt;br /&gt;
&lt;br /&gt;
To add the Active Person as a child of an existing family, select the {{man button|Add Existing Parents}} button from the toolbar (in older versions of GRAMPS, this button was simply called ''Share''). This will allow you to select an existing family, and adds the Active Person as a child of that family.&lt;br /&gt;
&lt;br /&gt;
=== Adding a Person as a Child of the Active Person ===&lt;br /&gt;
&lt;br /&gt;
You may add a child to a family in which the Active Person is a parent in one of two ways. If the family already exists, then it will appear in the {{man label|Family}} section of the display. Click on the {{man label|edit}} icon, and the exiting family will be displayed in the Edit Family form.&lt;br /&gt;
&lt;br /&gt;
If the family to which you want to add a child is not displayed, then you should select the {{man button|Add Partner}} button (in older versions of GRAMPS, this button was simply called {{man label|Spouse}}). This will display an Edit Family form in which the Active Person is listed as either the father or the mother. At this point, you may add children and/or a spouse.&lt;br /&gt;
&lt;br /&gt;
== Adding a child from the Family View ==&lt;br /&gt;
[[image:edit-rel.png|right|thumb|250px| Family view]]&lt;br /&gt;
&lt;br /&gt;
If you wish to add a child to an existing family from the Family View, find the Family in the displayed list. You may either select the family a click on the {{man button|Edit}} button in the toolbar, or double-click on the family in the list. This will display the Edit Family form for this person. At this point, you may add the child.&lt;br /&gt;
&lt;br /&gt;
If you wish to add a child to a new family (a family that does not yet exist in the database), click on the {{man button|Add}} button on the toolbar. This will bring up an Edit Family form. On this form, you may add parents and children.&lt;br /&gt;
&lt;br /&gt;
= How do I add twins/triplets/etc? =&lt;br /&gt;
When you look at the list of children in a family, those with the same birthdate are obviously twins.  But if you don't know the birthdate, or only know the year, you need some other way to indicate the relationship.  You can do this by having them share a single birth event.&lt;br /&gt;
&lt;br /&gt;
Take for example, the twins Thomas and Peter.  When you create the Birth event for Thomas, make the Description say &amp;quot;Birth of Thomas and Peter&amp;quot;.  Then add a reference to that same event to Peter's event list, either by drag and drop, or by using the &amp;quot;Share an existing event&amp;quot; button.  Set the Role for that event for both people to &amp;quot;Primary&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now when you view the event list for either Thomas or Peter, you will see the Description reminding you that they are twins.  And as you add details such as birth date to the birth event for either of them, those details will automatically display for the other as well.&lt;br /&gt;
&lt;br /&gt;
= Adding other informations =&lt;br /&gt;
== Adding an occupation or other special informations ==&lt;br /&gt;
It is sometimes indicated in old documents that the person's activity was brewer, nails maker, woodchoper, ...&lt;br /&gt;
Edit the person and select the Attribute Tab. There add a new Attribute to add &amp;amp; select the wished information type you want to add &lt;br /&gt;
&lt;br /&gt;
== Related articles ==&lt;br /&gt;
*[[Add a spouse]]&lt;br /&gt;
*[[Add a godfather-godmother]]&lt;br /&gt;
*[[Add a witness]]&lt;/div&gt;</summary>
		<author><name>Diggernet</name></author>
		
	</entry>
</feed>