diff --git a/lib/spack/spack/cmd/graph.py b/lib/spack/spack/cmd/graph.py
index ed3aed19463cf8d012f9670d1ebc5c6687687f53..f9011caef4761b4cd041d503d52e020d63348175 100644
--- a/lib/spack/spack/cmd/graph.py
+++ b/lib/spack/spack/cmd/graph.py
@@ -28,6 +28,7 @@
 
 import spack
 import spack.cmd
+import spack.store
 from spack.spec import *
 from spack.graph import *
 
@@ -73,7 +74,7 @@ def graph(parser, args):
         if args.specs:
             tty.die("Can't specify specs with --installed")
         args.dot = True
-        specs = spack.installed_db.query()
+        specs = spack.store.db.query()
 
     else:
         specs = spack.cmd.parse_specs(
diff --git a/lib/spack/spack/cmd/setup.py b/lib/spack/spack/cmd/setup.py
index 953906975e40020ffc52a788d8e5d88c47af745b..82c5e4cb4ed9616d7af72de4eb863e7fa6c85ab1 100644
--- a/lib/spack/spack/cmd/setup.py
+++ b/lib/spack/spack/cmd/setup.py
@@ -30,6 +30,7 @@
 
 import llnl.util.tty as tty
 import spack
+import spack.store
 import spack.cmd
 import spack.cmd.install as install
 import spack.cmd.common.arguments as arguments
@@ -130,7 +131,7 @@ def setup(self, args):
         tty.die("spack setup only takes one spec.")
 
     # Take a write lock before checking for existence.
-    with spack.installed_db.write_transaction():
+    with spack.store.db.write_transaction():
         spec = specs[0]
         if not spack.repo.exists(spec.name):
             tty.warn("No such package: %s" % spec.name)