diff --git a/examples/branin/restore_state.py b/examples/branin/restore_state.py
index 12cb6b51d..55cce7426 100644
--- a/examples/branin/restore_state.py
+++ b/examples/branin/restore_state.py
@@ -23,12 +23,15 @@ def main():
         'deterministic' : True,
         'output_dir' : 'restore_me'}
     original_scenario = Scenario(orig_scen_dict)
-    smac = SMAC(scenario=original_scenario)
+    smac = SMAC(scenario=original_scenario,
+                run_id=1)
     smac.optimize()
 
     print("\n########## BUDGET EXHAUSTED! Restoring optimization: ##########\n")
 
-    # Now the output is in the folder 'restore_me'
+    # Now the output is in the folder 'restore_me/run_1' (or whatever run_id has
+    # been passed to the SMAC-object above)
+    old_output_dir = os.path.join(original_scenario.output_dir, 'run_1')
     #
     # We could simply modify the scenario-object, stored in
     # 'smac.solver.scenario' and start optimization again:
@@ -43,22 +46,18 @@ def main():
                       'output_dir' : 'restored'})
 
     # We load the runhistory, ...
-    rh_path = os.path.join(original_scenario.output_dir, "runhistory.json")
+    rh_path = os.path.join(old_output_dir, "runhistory.json")
     runhistory = RunHistory(aggregate_func=None)
     runhistory.load_json(rh_path, new_scenario.cs)
     # ... stats, ...
-    stats_path = os.path.join(original_scenario.output_dir, "stats.json")
+    stats_path = os.path.join(old_output_dir, "stats.json")
     stats = Stats(new_scenario)
     stats.load(stats_path)
     # ... and trajectory.
-    traj_path = os.path.join(original_scenario.output_dir, "traj_aclib2.json")
+    traj_path = os.path.join(old_output_dir,  "traj_aclib2.json")
     trajectory = TrajLogger.read_traj_aclib_format(
         fn=traj_path, cs=new_scenario.cs)
     incumbent = trajectory[-1]["incumbent"]
-    # Because we changed the output_dir, we might want to copy the old
-    # trajectory-file (runhistory and stats will be complete)
-    new_traj_path = os.path.join(new_scenario.output_dir, "traj_aclib2.json")
-    shutil.copy(traj_path, new_traj_path)
 
     # Now we can initialize SMAC with the recovered objects and restore the
     # state where we left off. By providing stats and a restore_incumbent, SMAC
@@ -66,7 +65,14 @@ def main():
     smac = SMAC(scenario=new_scenario,
                 runhistory=runhistory,
                 stats=stats,
-                restore_incumbent=incumbent)
+                restore_incumbent=incumbent,
+                run_id=1)
+    # Because we changed the output_dir, we might want to copy the old
+    # trajectory-file (runhistory and stats will be complete, but trajectory is
+    # written sequentially)
+    new_traj_path = os.path.join(new_scenario.output_dir, "run_1",  "traj_aclib2.json")
+    shutil.copy(traj_path, new_traj_path)
+
     smac.optimize()
 
 if "__main__" == __name__:
diff --git a/smac/facade/smac_facade.py b/smac/facade/smac_facade.py
index 3368bac94..5b315dec3 100644
--- a/smac/facade/smac_facade.py
+++ b/smac/facade/smac_facade.py
@@ -128,15 +128,26 @@ class SMAC(object):
         aggregate_func = average_cost
 
         self.scenario = scenario
-        self.output_dir = create_output_directory(scenario, run_id)
+        self.output_dir = ""
+        if not restore_incumbent:
+            self.output_dir = create_output_directory(scenario, run_id)
+        elif scenario.output_dir is not None:
+            # output-directory is created in CLI when restoring from a
+            # folder. calling the function again in the facade results in two
+            # folders being created: run_X and run_X.OLD. if we are
+            # restoring, the output-folder exists already and we omit creating it,
+            # but set the self-output_dir to the dir.
+            # necessary because we want to write traj to new output-dir in CLI.
+            self.output_dir = os.path.join(scenario.output_dir,
+                                           "run_%d" % (run_id))
         if (
             scenario.deterministic is True
             and getattr(scenario, 'tuner_timeout', None) is None
             and scenario.run_obj == 'quality'
         ):
             self.logger.info('Optimizing a deterministic scenario for '
-                             'qualitiy without a tuner timeout - will make '
-                             'SMAC deterministi!')
+                             'quality without a tuner timeout - will make '
+                             'SMAC deterministic!')
             scenario.intensification_percentage = 1e-10
         scenario.write()
 
@@ -175,7 +186,7 @@ class SMAC(object):
         # initial acquisition function
         if acquisition_function is None:
             acquisition_function = EI(model=model)
-            
+
         # inject model if necessary
         if acquisition_function.model is None:
             acquisition_function.model = model
diff --git a/smac/smac_cli.py b/smac/smac_cli.py
index b2382c0c7..4bab14f49 100644
--- a/smac/smac_cli.py
+++ b/smac/smac_cli.py
@@ -64,21 +64,19 @@ class SMACCLI(object):
         stats = None
         incumbent = None
 
-        # Restore state (needs to be before scenario-creation!)
-        if args_.restore_state:
-            root_logger.debug("Restoring state from %s...", args_.restore_state)
-            rh, stats, traj_list_aclib, traj_list_old = self.restore_state_before_scen(args_)
-
         # Create scenario-object
         scen = Scenario(args_.scenario_file, misc_args)
 
-        # Restore state (continued, needs to be after scenario-creation!)
+        # Restore state
         if args_.restore_state:
+            root_logger.debug("Restoring state from %s...", args_.restore_state)
+            rh, stats, traj_list_aclib, traj_list_old = self.restore_state(scen, args_)
+
             scen.output_dir_for_this_run = create_output_directory(
                 scen, args_.seed, root_logger,
             )
             scen.write()
-            stats, incumbent = self.restore_state_after_scen(scen, stats,
+            incumbent = self.restore_state_after_output_dir(scen, stats,
                                            traj_list_aclib, traj_list_old)
 
         if args_.warmstart_runhistory:
@@ -129,12 +127,9 @@ class SMACCLI(object):
         except (TAEAbortException, FirstRunCrashedException) as err:
             self.logger.error(err)
 
-    def restore_state_before_scen(self, args_):
+    def restore_state(self, scen, args_):
         """Read in files for state-restoration: runhistory, stats, trajectory.
         """
-        # Construct dummy-scenario for object-creation (mainly cs is needed)
-        tmp_scen = InputReader().read_scenario_file(args_.scenario_file)
-        tmp_scen = Scenario(tmp_scen, cmd_args={'output_dir':''})
         # Check for folder and files
         rh_path = os.path.join(args_.restore_state, "runhistory.json")
         stats_path = os.path.join(args_.restore_state, "stats.json")
@@ -145,9 +140,9 @@ class SMACCLI(object):
            raise FileNotFoundError("Could not find folder from which to restore.")
         # Load runhistory and stats
         rh = RunHistory(aggregate_func=None)
-        rh.load_json(rh_path, tmp_scen.cs)
+        rh.load_json(rh_path, scen.cs)
         self.logger.debug("Restored runhistory from %s", rh_path)
-        stats = Stats(tmp_scen)  # Need to inject actual scenario later for output_dir!
+        stats = Stats(scen)
         stats.load(stats_path)
         self.logger.debug("Restored stats from %s", stats_path)
         with open(traj_path_aclib, 'r') as traj_fn:
@@ -156,13 +151,11 @@ class SMACCLI(object):
             traj_list_old = traj_fn.readlines()
         return rh, stats, traj_list_aclib, traj_list_old
 
-    def restore_state_after_scen(self, scen, stats, traj_list_aclib,
-                                 traj_list_old):
-        """Finish processing files for state-restoration. The actual scenario
-        needs to be injected into stats, as well as the trajectory dealt with
-        (it is read in, but needs to be written to new output-folder after
-        scenario is constructed."""
-        stats.scenario = scen  # inject actual scen for output_dir
+    def restore_state_after_output_dir(self, scen, stats, traj_list_aclib,
+                                       traj_list_old):
+        """Finish processing files for state-restoration. Trajectory
+        is read in, but needs to be written to new output-folder. Therefore, the
+        output-dir is created. This needs to be considered in the SMAC-facade."""
         # write trajectory-list
         traj_path_aclib = os.path.join(scen.output_dir, "traj_aclib2.json")
         traj_path_old = os.path.join(scen.output_dir, "traj_old.csv")
@@ -171,8 +164,9 @@ class SMACCLI(object):
         with open(traj_path_old, 'w') as traj_fn:
             traj_fn.writelines(traj_list_old)
         # read trajectory to retrieve incumbent
+        # TODO replace this with simple traj_path_aclib?
         trajectory = TrajLogger.read_traj_aclib_format(fn=traj_path_aclib, cs=scen.cs)
         incumbent = trajectory[-1]["incumbent"]
         self.logger.debug("Restored incumbent %s from %s", incumbent,
                           traj_path_aclib)
-        return stats, incumbent
+        return incumbent

Path to scenario folder to restore state
Hi,

I was running the example on restoring the state for the branin function and I run into this error

```
INFO:smac.scenario.scenario.Scenario:Output to restored
Output directory= restore_me/run_1
['traj_old.csv', 'scenario.txt', 'runhistory.json', 'param_config_space.pcs', 'stats.json', 'traj_aclib2.json']
Traceback (most recent call last):
  File "restore_state.py", line 77, in <module>
    main()
  File "restore_state.py", line 64, in main
    shutil.copy(traj_path, new_traj_path)
  File "/usr/lib/python3.5/shutil.py", line 235, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.5/shutil.py", line 115, in copyfile

    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'restored/traj_aclib2.json'
```

I figure the issue comes from this line:
https://github.com/automl/SMAC3/blob/56a5af9e3666ae54f7c126b62ae44852af65842d/examples/branin/restore_state.py#L46

The output scenario folder should redefined as `output_dir = os.path.join(original_scenario.output_dir, 'run_1')`, right?

diff --git a/test/test_cli/test_restore_state.py b/test/test_cli/test_restore_state.py
index 8bcc3f066..1459b5fa9 100644
--- a/test/test_cli/test_restore_state.py
+++ b/test/test_cli/test_restore_state.py
@@ -40,6 +40,7 @@ class TestSMACCLI(unittest.TestCase):
         for output_dir in self.output_dirs:
             if output_dir:
                 shutil.rmtree(output_dir, ignore_errors=True)
+                #pass
         os.chdir(self.current_dir)
 
     @attr('slow')
@@ -100,7 +101,12 @@ class TestSMACCLI(unittest.TestCase):
         # Increase limit and run for 10 (so 5 more) by using restore_state
         testargs = ["python", "scripts/smac", "--restore_state",
                     self.output_one, "--scenario_file",
-                    self.scenario_one, "--verbose", "DEBUG"]
+                    self.scenario_two, "--verbose", "DEBUG"]
         with mock.patch.object(sys, 'argv', testargs):
             self.smaccli.main_cli()
+        self.assertTrue(os.path.exists(self.output_one))
+        self.assertFalse(os.path.exists(self.output_one + '.OLD'))
+        self.assertTrue(os.path.exists(self.output_two))
+        self.assertFalse(os.path.exists(self.output_two + '.OLD'))
+
 

pip install -e .
parse_log_pytest
requirements.txt
nose pytest
apt-get update apt-get install -y build-essential swig
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
ConfigSpace==0.4.19
Cython==3.0.12
docutils==0.18.1
filelock==3.4.1
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
Jinja2==3.0.3
joblib==1.1.1
MarkupSafe==2.0.1
nose==1.3.7
numpy==1.19.5
packaging==21.3
pluggy==1.0.0
psutil==7.0.0
py==1.11.0
Pygments==2.14.0
pynisher==0.6.4
pyparsing==3.1.4
pyrfr==0.8.2
pytest==7.0.1
pytz==2025.2
requests==2.27.1
scikit-learn==0.24.2
scipy==1.5.4
six==1.17.0
-e git+https://github.com/automl/SMAC3.git@4e3816d77bc3d2b5406bb71b2fe93da2831ebb0f#egg=smac
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
threadpoolctl==3.1.0
tomli==1.2.3
typing==3.7.4.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: SMAC3
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - configspace==0.4.19
      - cython==3.0.12
      - docutils==0.18.1
      - filelock==3.4.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - joblib==1.1.1
      - markupsafe==2.0.1
      - nose==1.3.7
      - numpy==1.19.5
      - packaging==21.3
      - pluggy==1.0.0
      - psutil==7.0.0
      - py==1.11.0
      - pygments==2.14.0
      - pynisher==0.6.4
      - pyparsing==3.1.4
      - pyrfr==0.8.2
      - pytest==7.0.1
      - pytz==2025.2
      - requests==2.27.1
      - scikit-learn==0.24.2
      - scipy==1.5.4
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - threadpoolctl==3.1.0
      - tomli==1.2.3
      - typing==3.7.4.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/SMAC3

test/test_cli/test_restore_state.py::TestSMACCLI::test_same_dir
test/test_cli/test_restore_state.py::TestSMACCLI::test_illegal_input test/test_cli/test_restore_state.py::TestSMACCLI::test_missing_dir test/test_cli/test_restore_state.py::TestSMACCLI::test_run_and_restore
smac/smac_cli.py smac/facade/smac_facade.py examples/branin/restore_state.py
smac/smac_cli.py smac/facade/smac_facade.py examples/branin/restore_state.py