Let a locally integrable function $u: D \rightarrow \mathbb R$ has weak derivative $Du$ and let $K:=\operatorname{supp} u \subset D$.
Let's define $v(x)=u(x)$ on $D$ and $v(x)=0$ on $\mathbb R^n \setminus D$.
Is it then $Dv=Du$ on $D$ and $Dv=0$ on $\mathbb R^n \setminus D$ ?
Copied from the comments:
Yes. You can use the fact that there is a smooth function ϕ on $R^n$ with support in D, such that ϕ=1 in an open neighbourhood of K. Then you decompose any test function f as ϕf+(1−ϕ)f.