'Backup the stack.
Get a Stack containing any in-progress resources from the previous
stack state prior to an update.'

@profiler.trace('Stack._backup_stack', hide_args=False)
def _backup_stack(self, create_if_missing=True):

    s = stack_object.Stack.get_by_name_and_owner_id(self.context, self._backup_name(), owner_id=self.id)
    if (s is not None):
        LOG.debug('Loaded    existing    backup    stack')
        return self.load(self.context, stack=s)
    elif create_if_missing:
        kwargs = self.get_kwargs_for_cloning()
        kwargs['owner_id'] = self.id
        del kwargs['prev_raw_template_id']
        prev = type(self)(self.context, self._backup_name(), copy.deepcopy(self.t), **kwargs)
        prev.store(backup=True)
        LOG.debug('Created    new    backup    stack')
        return prev
    else:
        return None
