# Reinitialize PEngines Instance Completely without Exiting SWI-Prolog?

**URL:** <https://swi-prolog.discourse.group/t/reinitialize-pengines-instance-completely-without-exiting-swi-prolog/1960>\
**Category:** Help!\
**Tags:** pengines\
**Created:** [March 5, 2020, 3:52am UTC](https://swi-prolog.discourse.group/t/reinitialize-pengines-instance-completely-without-exiting-swi-prolog/1960 "2020-03-05T03:52:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prodog](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@prodog](https://swi-prolog.discourse.group/u/prodog)\
**Post date:** [March 5, 2020, 3:52am UTC](https://swi-prolog.discourse.group/t/reinitialize-pengines-instance-completely-without-exiting-swi-prolog/1960/1 "2020-03-05T03:52:02Z")

</div>

When I am in development mode, I frequently make changes to several source files. Currently, in order to reinitialize my PEngines instance, I exit the SWI-Prolog console completely and restart SWI-Prolog. This is the easiest way for me to reset my environment, because I have predicates in my _swipl.ini_ file that need to be executed to set up and run the PEngines server. Now that I am about to duplicate my local PEngines instance onto my server box, I’d like to streamline that process to make my life easier.

Is there a way to do this from within SWI-Prolog? Something that would duplicate the behavior of running SWI-Prolog from scratch so that it would clear out nearly everything and then re-execute the initialization file? That would save me a lot of trouble when compare to the process of completely exiting and restarting SWI-Prolog each time.

If not, how are those of you with live PEngines instances in the cloud restarting your instances when you want a fresh start after changing a slew of source files?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [March 5, 2020, 7:53am UTC](https://swi-prolog.discourse.group/t/reinitialize-pengines-instance-completely-without-exiting-swi-prolog/1960/2 "2020-03-05T07:53:37Z")

</div>

In most cases, and especially when using modules all over the place, simply run `?- make.`. That will reload all changed files. That should typically do the job. There are some exceptions, one being term/goal expansion rules that you change. The system doesn’t keep track where they are used, so a restart is the only option. You may also need to be careful about `initialization` directives that change the environment to make sure you can run them twice.

For me, when doing application development, restarting fresh is rare and I easily find myself working in the same instance the whole day.

Working in `swipl.ini` is probably not a good idea. It is meant to tweak the Prolog environment a bit to support development such as setting up command line history, the editor to use, etc.

---

<div class="post-metadata">

**Author:** ![prodog](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@prodog](https://swi-prolog.discourse.group/u/prodog)\
**Post date:** [March 5, 2020, 9:44pm UTC](https://swi-prolog.discourse.group/t/reinitialize-pengines-instance-completely-without-exiting-swi-prolog/1960/3 "2020-03-05T21:44:47Z")

</div>

Thanks Jan. I’ll try that.
