Moving the OctoPrint installation directory

I followed the instructions to set up OctoPrint on my Raspberry Pi running Raspbian. It's running nicely and starts on boot.

However, I would like to move the installation directory from ~/OctoPrint to ~/bin/OctoPrint to keep my home directory organized. When I move the directory, OctoPrint will no longer run:

~/bin/OctoPrint/venv/bin $ ./octoprint
-bash: ./octoprint: /home/keavon/OctoPrint/venv/bin/python2: bad interpreter: No such file or directory

Can I please have a complete list of steps needed to update my installation for its life in a new location?

It's relatively simple. Due the link, change the fourth line to:

mkdir OctoPrint && cd OctoPrint -> mkdir bin/OctoPrint && cd bin/OctoPrint

If you would be sure to make all changes has effect, rename origin folder:

OctoPrint -> OctoPrint.old

and

.octoprint -> .octoprint.old

too.
So you have a chance to step back if something would be wrong and be sure the new position is running. Don't forget to modify the configuration file (if you are automtically running the OctoPrint server) in:

/etc/default/octoprint

if you are running Armbian...

Good luck

Hello, thanks for the reply. I am a bit confused reading what you wrote, but it looks like you are suggesting that I rename the old directory and then follow the steps again to reinstall the program? Is there a simpler way to just move my existing installation?

Oh, I am very sorry. Yes you are right, you have to repeat the installation process againg due the link above with your changes in creating new path.
I don't know if exist simpler process to move Octoprint to new location, but I am affraid not because during the installation the actual paths are builded-in into installation (I think).

$ bin/OctoPrint/venv/bin/octoprint serve
2019-06-23 17:28:23,976 - octoprint.startup - INFO - ******************************************************************************
2019-06-23 17:28:23,979 - octoprint.startup - INFO - Starting OctoPrint 1.3.11
2019-06-23 17:28:23,980 - octoprint.startup - INFO - Starting in SAFE MODE. Third party plugins will be disabled!
2019-06-23 17:28:23,980 - octoprint.startup - INFO - Reason for safe mode: problem during last startup
2019-06-23 17:28:23,981 - octoprint.startup - INFO - ******************************************************************************
2019-06-23 17:28:25,184 - octoprint.util.connectivity_checker - INFO - Connectivity changed from offline to online
2019-06-23 17:28:25,189 - octoprint.startup - INFO - Blacklist processing done, adding 1 blacklisted plugin versions: roomtemp (any)
2019-06-23 17:28:25,230 - octoprint.plugin.core - INFO - Loading plugins from /home/keavon/bin/OctoPrint/venv/lib/python2.7/site-packages/octoprint/plugins, /home/keavon/.octoprint/plugins and installed plugin packages...
2019-06-23 17:28:27,412 - octoprint.plugins.octoprint.plugins.discovery - INFO - pybonjour is not installed, Zeroconf Discovery won't be available
2019-06-23 17:28:27,430 - octoprint.plugin.core - INFO - Found 15 plugin(s) providing 15 mixin implementations, 23 hook handlers
2019-06-23 17:28:27,570 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2019-06-23 17:28:27,605 - octoprint.cli.server - ERROR - Uncaught exception
Traceback (most recent call last):
  File "bin/OctoPrint/venv/bin/octoprint", line 10, in <module>
    sys.exit(main())
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/__init__.py", line 609, in main
    octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/cli/server.py", line 206, in serve_command
    ignore_blacklist)
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/cli/server.py", line 118, in run_server
    octoprint_server.run()
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/server/__init__.py", line 267, in run
    self._start_intermediary_server()
  File "/home/keavon/bin/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/server/__init__.py", line 1730, in _start_intermediary_server
    self._intermediary_server.server_bind()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "/usr/lib/python2.7/SocketServer.py", line 431, in server_bind
    self.socket.bind(self.server_address)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use

The reason the OctoPi image was created was so that a dedicated $35 computer could be used to serve this up. In my humble opinion, "organizing the home directory" isn't required and only serves to break a perfectly working collection of activities.

I am not using OctoPi, I am installing OctoPrint on my regular Raspberry Pi that I use for many other purposes. That would be a pretty bad design if the software requires such a nonportable installation environment, do you know if that is actually the case, and the reason for the errors printed in my above reply that show up after performing the installation instructions elsewhere from the home directory?

On the plus side, OctoPrint is open source so feel free to search through the github repository to determine what's required to change it to suit your needs.